-
February 6th, 2002, 01:30 AM
#1
Paint an irregular shape
How can I paint an irregular shape (no boxes, no circles,); when the program is running makes these shapes with lines using LINE(X,Y)-(X2,Y2).....I want the program paint these solids....I made a program to simulate the movement of a mechanism....I need those solids filled of color.
-
February 6th, 2002, 03:58 AM
#2
Re: Paint an irregular shape
Check the API FloodFill and ExtFloodFill. They allow you to fill a region of DC with a color specified by the border...
RK
-
February 8th, 2002, 02:54 PM
#3
Re: Paint an irregular shape
These days I tried to use API, according to your tip, but it's my first time.
And I receive a lot error messages...syntax error...function colorref not defined...function uint not defined.....Don't you mind if I ask you, say me, which conditions I have to follow to use ExtFloodFill....declarations, modules, types,..anything .
I REALLY APPRECIATE YOUR HELP..THANKS A LOT
-
February 8th, 2002, 04:50 PM
#4
Re: Paint an irregular shape
Hi, here is what you need:
'in the declarations:
private Declare Function ExtFloodFill Lib "gdi32" _
(byval hdc as Long, byval X as Long, _
byval Y as Long, byval crColor as Long, _
byval wFillType as Long) as Long
'then in the routine to floodfill:
ExtFloodFill YourControl.hdc, X, Y, TheColorOfTheOutline, 0&
' the X and Y coords are in pixels, not twips!!! typically, anywhere inside the shape will do.
Let me know how it goes.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
February 10th, 2002, 01:20 PM
#5
Re: Paint an irregular shape
I try the code that you sent me, it doesn't fail, but does nothing....
may be my problem is that my shape is a different screen, where the API works...I try some API samples, but all of them create an object ellipse, circle (in a different way than using CIRCLE(X,Y)...)
in the screen I have my drawing the closest result is with FILLCOLOR and FILLSTYLE, but it fills CIRCLES(X,Y)..doesn't detect my shape....until know, with API, I only can fill with color circles, ellipses, created inside the API ... I REALLY APPRECIATE YOUR HELP
-
February 10th, 2002, 07:20 PM
#6
Re: Paint an irregular shape
First, make sure the FillStyle for your picturebox or whatever is set to Solid. Also, make sure the X and Y coords for the api are in pixels, even if you are using twips for the shape. You may also have to set AutoRefresh to True. Be sure to use the real color value, not a system color value. Let me know how it goes.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|