Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
'In this example, Graphic Controls are used as the graphic targets.
#Compiler PBWin 9, PBWin 10
#Compile Exe
#Dim All
%Unicode=1
#Include "Win32API.inc"
#Include "GDIPLUS_Simple.INC"
Global hDlg,hGraphic As Dword
%IDC_Graphic = 101
Function PBMain() As Long
Dialog New Pixels, 0, "GDI+ Load Image Test",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 110,"PNG", 10,10,60,20
Control Add Graphic, hDlg, %IDC_Graphic, "", 20, 40, 125, 125 ' Add a graphic control
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command Then
Select Case Cb.Ctl
Case 110
hGraphic = GraphicLoadImageFileToBitmap("test.png"\" & photo,200,200)
Graphic Copy hGraphic, %IDC_Graphic
Graphic ReDraw
End Select
End If
End Function
'gbs_01297
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm