Gerekenler: 1 adet picturebox,1 adet timer.
Timer'ın interval = 1 yapın
Formun General bölümüne şunları yapıştırın
timer:
Resmi formun büyüklüğüne uydurmak için ise bi tane daha timer ekleyin ve koduna şunları yazın:
timer'ın intervalını 1 yapın
Timer'ın interval = 1 yapın
Formun General bölümüne şunları yapıştırın
Kod:
Option Explicit
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, _
ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, _
ByVal YSrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" _
(ByVal hwnd As Long, ByVal hDC As Long) As Long
timer:
Kod:
On Error Resume Next
Dim hd, w, h ' Geri dönüş değişkenleri
Picture1.AutoRedraw = True ' Resmin görüntüleme içIn
w = Screen.Width / Screen.TwipsPerPixelX ' Resim boyutu
h = Screen.Height / Screen.TwipsPerPixelY
hd = GetDC(GetDesktopWindow())
' Resmi Belirtilen ResimKutusu objesine aktar
Call BitBlt(Picture1.hDC, 0, 0, w, h, hd, 0, 0, &HCC0020)
Call ReleaseDC(GetDesktopWindow(), hd)
' Resmi görüntülemek için yenile
Picture1.*******
Resmi formun büyüklüğüne uydurmak için ise bi tane daha timer ekleyin ve koduna şunları yazın:
timer'ın intervalını 1 yapın
Kod:
Picture1.Width = Form1.Width
Picture1.Height = Form1.Height
Son düzenleme:

