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"
%IDC_Graphic = 500 : %IDC_Count = 501
Global hDlg As Dword, bmp$
Function PBMain() As Long
Dialog New Pixels, 0, "Count Colors",300,300,450,250, %WS_OverlappedWindow + %CS_HRedraw + %CS_VRedraw To hDlg
Control Add Button, hDlg, %IDC_Count, "Get Color Count", 10,10,140,20
Control Add Graphic, hDlg, %IDC_Graphic, "", 10,40,400,200
Graphic Attach hDlg, %IDC_Graphic
Graphic Render "cowboy.bmp", (0,0)-(399,199)
Graphic Get Bits To bmp$
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDC_Count : GetCount
End Select
End Select
End Function
Sub GetCount
? "Count = "
End Sub
'gbs_00861
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm