Posts: 1,769
Threads: 410
Joined: Feb 2003
i'm trying to use this to create a small circle (about this size " :?: " but can't seem to get it to go very small.
can it be done?
Posts: 12,073
Threads: 140
Joined: Dec 2002
I think yes. Show the code.
Posts: 1,769
Threads: 410
Joined: Feb 2003
here's what i'm calling with.
Macro
int hwnd=OnScreenDraw(-150 -30 150 150 &OSD_Proc_Red_Light 0 210)
and here's what i'm calling:
Function
OSD_Proc_Red_Light
;/Macro527
function hwnd hdc cx cy param
;out cx
;out cy
int hpen oldpen hbrush oldbrush oldfont
;;create/select pen and draw rectangle
;hpen=CreatePen(0 10 0xff0000); oldpen=SelectObject(hdc hpen)
;;Rectangle hdc 5 5 cx-10 cy-10 ;;simple
;RoundRect hdc 5 5 cx-10 cy-10 20 20 ;;rounded corners
;DeleteObject SelectObject(hdc oldpen)
;create/select brush and pen, and draw ellipse
hbrush=CreateSolidBrush(0x0000ff); oldbrush=SelectObject(hdc hbrush)
hpen=CreatePen(0 13 0x0000ff); oldpen=SelectObject(hdc hpen)
Ellipse hdc 50 50 cx-50 cy-50
DeleteObject SelectObject(hdc oldbrush)
DeleteObject SelectObject(hdc oldpen)
;;draw icon
;int hicon=GetFileIcon("$qm$" 0 1)
;DrawIconEx hdc cx/2-16 40 hicon 32 32 0 0 3
;DestroyIcon hicon
;;draw text
;str txt="Some Text"
;;create font. To create fonts easily, download CFont class from the forum
;#ifdef CFont
;CFont hfont.Create("Tahoma" 25 0)
;oldfont=SelectObject(hdc hfont)
;#endif
;set text color and transparent background
;SetTextColor(hdc 0x00ffff)
;SetBkMode(hdc TRANSPARENT)
;set rectangle
;RECT r
;DrawText hdc txt -1 &r DT_CALCRECT
;OffsetRect &r 70 80
;draw
;DrawText hdc txt -1 &r 0
#ifdef CFont
SelectObject hdc oldfont
#endif
Posts: 12,073
Threads: 140
Joined: Dec 2002
Macro
int hwnd=OnScreenDraw(150 30 20 20 &OSD_Proc_Red_Light 0 210)
2
Function
OSD_Proc_Red_Light
;/
function hwnd hdc cx cy param
int hpen oldpen hbrush oldbrush
;create/select brush and pen, and draw ellipse
hbrush=CreateSolidBrush(0x0000ff); oldbrush=SelectObject(hdc hbrush)
hpen=CreatePen(0 1 0x0000ff); oldpen=SelectObject(hdc hpen)
Ellipse hdc 0 0 cx cy
DeleteObject SelectObject(hdc oldbrush)
DeleteObject SelectObject(hdc oldpen)
Posts: 1,769
Threads: 410
Joined: Feb 2003
this is FANTASTIC!!!!
little blinky lights everywhere! 8)
thanks so much!