Results 1 to 8 of 8

Thread: layered painting in a picturebox

  1. #1

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    layered painting in a picturebox

    I want do do layered painting in a picturebox,
    but I can't figure out how to get the top layers transparent.
    For example on layer 1 should be the background colour/picture, layer2 should have some lines, layer3 some circles.
    Can anyone give me a little help?
    Thanks
    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!

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The only real way to do this would be to use DDraw, but, then again, that is a little advanced (maybe?). You can also use BitBlt to make your drawings transparent, if you don't know bitblt I can give you a link to my tut.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I'm using BitBlt, but not with a transparent background.
    But whow do I handle the differnt layers? Whow do I store them?
    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!

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    My suggestion is make a UDT that stores an hDC, X, Y, Width, Height, and Layer. Then you can put in something to blit an array of that UDT, in the correct layer order. That's what I would do.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    UDT= User Defined Type
    I'm getting the point, hopefully ;-)
    Thanks for the help I'm off for some studying

    BTW could you send me the link for transparent bitblt?
    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
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  7. #7

    Thread Starter
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    I've done something that looks like what I want to have, but is it really neccessary to draw each "Layer" twice?
    Here is what I do:
    Picturebox(0) is the background (autoredraw false all other pictureboxes have autoredraw true and visible false)

    picturebox(1) and ..(2) have to have the drawings of one layer (the drawings are identical exept for the colours), with ..(1) as the mask and ..(2) as the sprite. After drawing those two I can BitBlt then onto picturebox(0) as if ..(2) would have a transparent background.

    IS THAT REALLY NECCESSARY???????????? To me it look's a bit overdone!
    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!

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    No. The 'mask' sets which colour bits are transparent. Then the sprite gives the colour information. If you did it once then you would either have no transparency or a black silouhette.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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