Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnScreenDraw
#1
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?
A new blog on QM coding and automation.

The Macro Hook
#2
I think yes. Show the code.
#3
here's what i'm calling with.
Macro
Code:
Copy      Help
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
Code:
Copy      Help
;/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
A new blog on QM coding and automation.

The Macro Hook
#4
Macro
Code:
Copy      Help
int hwnd=OnScreenDraw(150 30 20 20 &OSD_Proc_Red_Light 0 210)
2

Function OSD_Proc_Red_Light
Code:
Copy      Help
;/
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)
#5
this is FANTASTIC!!!!
little blinky lights everywhere! 8)

thanks so much!
A new blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)