Results 1 to 13 of 13

Thread: Paint a picture box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174

    Paint a picture box

    How can i paint a figure i've drawed in a picture box using lines?

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Paint it where ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201
    Do you mean the line object or the picture box line method?

    - Dim A

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    I have a figure in a PictureBox where i have drawed using PictureBox.Line. I want to fill the figure with a color, not the whole PictureBox with BackColor.

  5. #5
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    You can't fill a "shape" that is made out off lines, instead you should use the SHPE object, that can be filled!
    By the way, if your figure needs to move fast, I would draw it using the line or circle methods.
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    You could fill the shape if you use the FloodFill() API...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    I am trying to make a graph, i didn't quite get the FloodFill API, and the graph can't be made of shapes, only by lines.

    How do you use the FloodFill API to fill ONLY the selected area, not the whole PictureBox?

  8. #8
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well floodfill works like the fill tool in mspaint.
    It will only fill in shapes etc.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    how can i make a graph then?

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    can't FloodFill() fill a closed area of lines?

  11. #11
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I meant it will fill in an enclosed area, made up any way you want.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    So if i a have an enclosed area of lines, i can fill it with FloodFill()?

    Can you give me and example of how FloodFill() works, when i use it either my computer crashes or it fills the entire Form, PictureBox, or whatever i am trying to fill

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Oct 2001
    Location
    Sweden
    Posts
    174
    I really need a good example of the FloodFill API

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