Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg,hDC,hBitmap As Dword, bm As Bitmap
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Graphic, hDlg, 100,"Push", 10,10,180,180, %WS_Border
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local hBMP, SourceDC, hDDTBMP As Dword, bm As Bitmap
Local hOrigBitmap As Dword
Select Case Cb.Msg
Case %WM_InitDialog
Graphic Bitmap New 100,100 To hDDTBMP
Graphic Attach hDDTBMP, 0
Graphic Get DC To hDC
hBmp = LoadImage ( %NULL, "cowgirl.bmp", %IMAGE_BITMAP, 0, 0, %LR_LOADFROMFILE)
hOrigBitmap = SelectObject(hDC,hBMP)
Graphic Attach hDlg, 100, ReDraw
Graphic Copy hDDTBMP, 0
End Select
End Function
'gbs_00959
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm