Các chiêu thức trong lập trình Chép cả màn hình làm việc vào một Picture home

1 560 0
Các chiêu thức trong lập trình Chép cả màn hình làm việc vào một Picture home

Đang tải... (xem toàn văn)

Thông tin tài liệu

Chép cả màn hình làm việc vào một Picture home Xuất xứ : www.ttvnol.com Binh khí sử dụng : 1 Picturemột nút ấn Đoạn mã : Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc 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 nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long Private Sub Command1_Click() Dim wScreen As Long Dim hScreen As Long Dim w As Long Dim h As Long Picture1.Cls wScreen = Screen.Width \ Screen.TwipsPerPixelX hScreen = Screen.Height \ Screen.TwipsPerPixelY Picture1.ScaleMode = vbPixels w = Picture1.ScaleWidth h = Picture1.ScaleHeight hdcScreen = GetDC(0) r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, 0, 0, wScreen, hScreen, vbSrcCopy) End Sub . Chép cả màn hình làm việc vào một Picture home Xuất xứ : www.ttvnol.com Binh khí sử dụng : 1 Picture và một nút ấn Đoạn mã : Private. Long Picture1 .Cls wScreen = Screen.Width Screen.TwipsPerPixelX hScreen = Screen.Height Screen.TwipsPerPixelY Picture1 .ScaleMode = vbPixels w = Picture1 .ScaleWidth

Ngày đăng: 24/10/2013, 14:20

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan