PDA

Click to See Complete Forum and Search --> : Use Just API


DrBrain
Apr 24th, 2000, 02:43 AM
I need to know how i can draw a rectangle on a form in the same with the same effect that you get when you place a shape-control on a form with FILLSTYLE set to 9.
I'm able to only draw solid rects.
The thing is that I need to use API Call. the LINE-command is no good.

Cougar0119
Apr 24th, 2000, 04:56 AM
What is Fillstyle - 9? I only have values 0 to 7 on my shape control...I can't tell you what Pen or Brush to use 'cause Fillstyle 9? But use anyways - the API function Rectangle - It should do what you want...btw - why wouldn't Line work?

Good Luck

Apr 24th, 2000, 05:48 AM
I don't know if this is the same as your problem, but lines always disappear when I draw them!!

Cougar0119
Apr 24th, 2000, 05:56 AM
If that's the problem set AutoRedraw = True or you can manually handle it by using the Paint event of the form/picturebox...

Good Luck!

[Edited by Cougar0119 on 04-24-2000 at 06:59 PM]

DrBrain
Apr 29th, 2000, 09:02 PM
I meant DRAWSTYLE instead of FILLSTYLE.
I'll try the Rectangle API. The reason why I can't use the line function is that I'm drawing on the desktop.

Sam Finch
Apr 30th, 2000, 12:50 AM
there's a LineTo and a moveto API, Private Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long

they should be usefull, I'm not sure what lpPoint is, it's probably an out parameter for the old point.