Страница: 1 | 2 |
|
Вопрос: Несколько вопросиков
|
Добавлено: 05.04.06 17:20
|
|
Номер ответа: 17 Автор ответа: Beralus_
ICQ: 255004422
Вопросов: 0 Ответов: 14
|
Профиль | | #17
|
Добавлено: 08.04.06 11:13
|
' Vot tak esli ya ponyal tebya:
' ( a kak poluchit cvet piksela et uje dosttochno obyasnili)
//=================================
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) 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 Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Const SRCCOPY = &HCC0020
' Copy the desktop's image into the form.
Private Sub GetScreenImage()
Dim desktop_rect As RECT
Dim desktop_win As Long
Dim desktop_dc As Long
Dim desktop_wid As Long
Dim desktop_hgt As Long
Dim x As Long
Dim y As Long
Dim wid As Long
Dim hgt As Long
desktop_win = GetDesktopWindow()
desktop_dc = GetDC(desktop_win)
GetWindowRect desktop_win, desktop_rect
desktop_wid = desktop_rect.Right
desktop_hgt = desktop_rect.Bottom
x = 0
wid = desktop_wid
y = 0
hgt = desktop_hgt
Width = ScaleX(Width - ScaleWidth + wid, vbPixels, vbTwips)
Height = ScaleY(Height - ScaleHeight + hgt, vbPixels, vbTwips)
StretchBlt hdc, x, y, wid, hgt, desktop_dc, 0, 0, desktop_wid, desktop_hgt, SRCCOPY
Picture = Image
ReleaseDC desktop_win, desktop_dc
End Sub
Private Sub Command1_Click()
GetScreenImage
End Sub
Ответить
|
Страница: 1 | 2 |
Поиск по форуму