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
Global imgName As String
Global imgW, imgH As Long
Function PBMain() As Long
Dialog New Pixels, 0, "Resource Size Text",300,300,600,410, %WS_OverlappedWindow To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local temp$, hBMP as DWord
Select Case CB.Msg
Case %WM_InitDialog
End Select
End Function
Sub GetBitmapDimensions
Local hBMP As DWord
Graphic Bitmap Load imgName, 0, 0 To hBMP
Graphic Attach hBMP, 0
Graphic Get Client To imgW, imgH
Graphic Bitmap End
End Sub
Sub GetIconDimensions(Warn As Long)
Local hIcon As DWord, P As IconInfo, tempz as AsciiZ * %Max_Path, temp$
tempz = imgName
hIcon = LoadImage(GetModuleHandle(""), tempz, %IMAGE_ICON, 0, 0, %LR_DEFAULTCOLOR)
GetIconInfo hIcon, P
DestroyIcon hIcon '
imgW = P.xHotSpot*2 : imgH = P.yHotSpot*2
End Sub
'gbs_01058
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm