Results 1 to 6 of 6

Thread: Hatching in a region???

  1. #1
    Guest
    Hi.

    I need to draw hatching in a region of a picturebox which is not define by the Createwhateverrgn Api.
    Example: I draw a circle, then I draw a line which is drawn accross the circle. How can I fill one side of the circle by defining an x,y point corresponding to the side to fill?

    Thanks.


  2. #2
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Go to my thread about pathfinding and read the explanation of my pathfindindin method. Just use the first part as fill function. Works great. I just did this in school!
    Sanity is a full time job

    Puh das war harter Stoff!

  3. #3
    Guest

    The first part???

    Hummm..

    The first part? Well, I have to admit I didn't get the relation between my problem and your pathfinding one. Could you explain again please? Are you talkig about your A method?

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    If it's painting a region with the same color then floodfill api is for you
    Code:
    Private Declare Function FloodFill Lib "GDI32" (ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
    'To use
    FloodFill hDC, 100, 100, vbRed
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Guest

    Thank you very much!

    Yep, that's what I need. I know Extfloodfill works great with hatching, but I haven't tried Floodfill.

    Thanks!

  6. #6
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    Of course the floodfill method is much better, than the way I proposed, just to explain:

    A function that calls itself very often, till all places in an multidimensional array (your bitmap), are filled! That's all
    Cu
    Sanity is a full time job

    Puh das war harter Stoff!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width