Date: 02-16-2022
Return to Index
created by gbSnippets
'... this snippet is in work
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
%IDC_Graphic = 500
Global hDlg, hDesktopDC, hGraphic, hGraphicDC As Dword
Function PBMain() As Long
Local w,h as Long
Desktop Get Size To w,h 'w,h are desktop dimensions
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
hDeskTopDC = GetDC(%Null)
Control Add Graphic, hDlg, %IDC_Graphic, "", 0,0,w,h
Graphic Attach hDlg, %IDC_Graphic
Graphic Get DC To hGraphicDC
BitBlt hGraphicDC, 0,0,w,h, hDeskTopDC, 0,0, %SRCCopy 'copy desktop image to
ReleaseDC(%Null,hDeskTopDC)
Dialog Show Modal hDlg
End Function
Function PBMain() As Long
Local w,h as Long
Desktop Get Size To w,h 'w,h are desktop dimensions
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Graphic, hDlg, %IDC_Graphic, "", 0,0,w,h
Graphic Attach hDlg, %IDC_Graphic
Sub GetScreenImage()
'puts screen image in current graphic target
Graphic Get DC To hTargetDC
hDeskTopDC = GetDC(%Null)
BitBlt hTargetDC, 0,0,w,h, hDeskTopDC, 0,0, %SRCCopy 'copy desktop image to
ReleaseDC(%Null,hDeskTopDC)
End Function
'gbs_01004
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm