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
#Resource Bitmap aaa, "cowgirl.bmp"
#Resource Bitmap bbb, "face.bmp"
Global hDlg,hBMPA,hBMPB As Dword
%IDC_Graphic = 500
%IDC_Button = 501
Function PBMain() As Long
Dialog New Pixels, 0, "Show Image",500,400,175,175, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, %IDC_Button, "Change Image", 10,10,120,20
Control Add Graphic, hDlg, %IDC_Graphic, "", 10,40,150,150
Graphic Attach hDlg, %IDC_Graphic
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Static Choice As Long
Select Case Cb.Msg
Case %WM_InitDialog
Graphic Bitmap Load "aaa", 0, 0 To hBMPA
Graphic Bitmap Load "bbb", 0, 0 To hBMPB
Graphic Copy IIf(Choice,hBMPA,hBMPB),0
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Button
Choice = Choice Xor 1
Graphic Clear
Graphic Copy IIf(Choice,hBMPA,hBMPB),0
End Select
End Select
End Function
'gbs_01117
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm