how to color a region difined by many points 
Author Message
 how to color a region difined by many points

    I need to color a shape that its difined by several points

    How can i do it with simple commands

    Thanks for you help

    :-)



Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points

If you're drawing the shape outline with VB methods, you can use the
FloodFill or ExtFloodFill Api functions to fill the enclosed area.
Alternatively you can use the Polygon Api function to both draw the
shape and fill it.

On Mon, 25 Sep 2000 14:11:50 +0100, "Adolfo Ferreira"

Quote:

>    I need to color a shape that its difined by several points
>    How can i do it with simple commands
>    Thanks for you help
>    :-)

-Tom
(please post replies to the newsgroup)


Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points

DONT USE FLOOD FILL, ITS VERY SLOW AND FULL OF ERRORS.
USE API  (POLYGON API.)

YOUR POINTS MUST BE ASSIGNED TO POLYGON CORNERS. POINTAPI (X,Y)

USE THE API'S LISTED BELOW
************************************
Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As
POINTAPI, ByVal nCount As Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI,
ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As
Long
Private Declare Function PtInRegion Lib "gdi32" (ByVal hRgn As Long, ByVal x
As Long, ByVal y As Long) As Long
****************************************
Private Type qtPolyInfo
  Start As Long
  Count As Long
  Name As String
  Color As Long
End Type
#If Win32 Then

    Type POINTAPI
        x As Long
        y As Long
    End Type

    Declare Function Polyline Lib "gdi32" (ByVal hdc As Long, lpPoint As
POINTAPI, ByVal nCount As Long) As Long
#Else
    Type POINTAPI
        x As Integer
        y As Integer
    End Type
    Declare Function Polyline Lib "GDI" (ByVal hdc As Integer, lpPoints As
POINTAPI, ByVal nCount As Integer) As Integer
#End If


Quote:

>     I need to color a shape that its difined by several points

>     How can i do it with simple commands

>     Thanks for you help

>     :-)



Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points

Uhh? What errors?

On Mon, 25 Sep 2000 18:54:40 +0300, "devrim"

Quote:

>DONT USE FLOOD FILL, ITS VERY SLOW AND FULL OF ERRORS.
>USE API  (POLYGON API.)...

-Tom
(please post replies to the newsgroup)


Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points
Nope, Tom: you just don't get it, do you.  There aren't any "errors".
Rather, (and to be quite specific) ITS VERY SLOW AND FULL OF
ERRORZ!!!1111!!1

Get with it, D00D!

Jim Deutch

Quote:

>Uhh? What errors?

>On Mon, 25 Sep 2000 18:54:40 +0300, "devrim"

>>DONT USE FLOOD FILL, ITS VERY SLOW AND FULL OF ERRORS.
>>USE API  (POLYGON API.)...

>-Tom
>(please post replies to the newsgroup)



Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points
Yeah, I know. That's the trouble with those old CS forum manners -
they often prevent me from being too "specific". <g>

On Mon, 25 Sep 2000 13:20:16 -0400, "Jim Deutch"

Quote:

>...Get with it, D00D!...

-Tom
(please post replies to the newsgroup)


Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points

flloodfill algorithm detects pixel colors.  The line drawing function of
vbasic is not so good. There may be gaps btw pixels when an inclined line is
drawn.....

ie.    00000100000
       00001000000
       00010000000
       00100000000
this represnts a line on a screen  0 is empty  1 is filled...  conventional
floodfill algorithm may leak btw one's


Quote:

>     I need to color a shape that its difined by several points

>     How can i do it with simple commands

>     Thanks for you help

>     :-)



Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points

Ok, it's been awhile but I have seen that with certain drivers.
However it's not a VB thing or an "error" with FloodFill. (VB uses the
same Windows GDI Api for graphics as everyone else.)

On Mon, 25 Sep 2000 21:39:59 +0300, "devrim"

Quote:

>flloodfill algorithm detects pixel colors.  The line drawing function of
>vbasic is not so good. There may be gaps btw pixels when an inclined line is
>drawn.....

-Tom
(please post replies to the newsgroup)


Fri, 14 Mar 2003 03:00:00 GMT  
 how to color a region difined by many points
I have used floodfill with my applications. and it leaked and slow. I know
that microsoft do it well but there are minor bugs in some applications. May
be the dll i used is wrong, dont know....

the same coordinates did well in polygon filling, but not with floodfill in
my application.

By the way not related with this topic, would u pls commnet at "win2k hd
serial number detection" topic.

thanks


Quote:
> flloodfill algorithm detects pixel colors.  The line drawing function of
> vbasic is not so good. There may be gaps btw pixels when an inclined line
is
> drawn.....

> ie.    00000100000
>        00001000000
>        00010000000
>        00100000000
> this represnts a line on a screen  0 is empty  1 is filled...
conventional
> floodfill algorithm may leak btw one's



> >     I need to color a shape that its difined by several points

> >     How can i do it with simple commands

> >     Thanks for you help

> >     :-)



Sat, 15 Mar 2003 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. how to color a region difined by many points

2. Retrieve Points in regions

3. Extracting point from a region??

4. VB5/gdi32, Q: how can i make a Region of a color

5. VB5/gdi32, Q: how can i make a Region of a color

6. ExtFloodFill to fill regions with color

7. #Region #End Region (code folding)?

8. Size/color of connection points

9. Getting Color Values of specific points on screen

10. Graphics control with point() equivalent function and replace color functions

11. API Point-type function (Color picking from the screen)

12. Displaying different colors for data point in bar graph

 

 
Powered by phpBB® Forum Software