Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile Exe
#Dim All
%Unicode = 1
#Include "Win32API.inc"
Enum Equates Singular
IDC_Graphic
End Enum
Global hDlg As Dword
Function PBMain() As Long
Local i As Long
Dialog New Pixels, 0, "PowerBASIC",600,300,300,300, %WS_OverlappedWindow To hDlg
Control Add Graphic, hDlg, %IDC_Graphic,"Push", 0,0,300,300
Graphic Attach hDlg, %IDC_Graphic
For i = 10 To 2 Step -1
Graphic Pie (60,40+i)-(260,200+i),0,2.7/12*3.14159, %Red, %rgb_LightBlue
Graphic Pie (60,40+i)-(260,200+i),2.7/12*3.14159,16/12*3.14159, %Green, %Green
Graphic Pie (60,40+i)-(260,200+i),16/12*3.14159,18/12*3.14159, %Yellow, %Yellow
Graphic Pie (60,40+i)-(260,200+i),18/12*3.14159,24/12*3.14159, %Blue, %Blue
Next i
Graphic Pie (60,40)-(260,200),0,2.7/12*3.14159, %Black, DarkColor(%rgb_LightBlue)
Graphic Pie (60,40)-(260,200),2.7/12*3.14159,16/12*3.14159, %Black, DarkColor(%Green)
Graphic Pie (60,40)-(260,200),16/12*3.14159,18/12*3.14159, %Black, DarkColor(%Yellow)
Graphic Pie (60,40)-(260,200),18/12*3.14159,24/12*3.14159, %Black, DarkColor(%Blue)
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_Graphic
? "Don't push me!"
End Select
End Select
End Function
Function DarkColor(TheColor As Long) As Long
Local rr,gg,bb As Long
RR = GetRValue(TheColor)
GG = GetGValue(TheColor)
BB = GetBValue(TheColor)
DarkColor = RGB(0.8*RR,0.8*GG,0.8*BB)
End Function
http://www.garybeene.com/sw/gbsnippets.htm