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"
#Resource "gbSnippets.pbr"
Global hDlg as DWord
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Control Add Graphic, hDlg, 200, "", 50,40,150,150
Graphic Attach hDlg, 200
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Msg = %WM_Command AND CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then
' Local hResInfo as DWord, hResData as DWord, w as Long, h as Long, iPointer as DWord
' hResInfo = FindResource GetModuleHandle(""), "cowgirl", %RT_BITMAP
' hResData = LoadResource GetModuleHandle(""), hResInfo
' iPointer = LockResource hResData
' Get #1, iPointer+19, w
' Get #1, iPointer+23, h
Local hBMP as DWord, w as Long, h as Long
Graphic Bitmap Load "cowgirl", 0, 0 to hBMP
Graphic Attach hBMP, 0
Graphic Get Client To w,h
MsgBox Str$(w) + Str$(h)
End If
End Function
'gbs_00425
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm