Results 1 to 4 of 4

Thread: Layers of Images

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    71

    Layers of Images

    Hi..

    i want to move two layers of images (like photoshop) above each other..

    for example.. suppose i have two images, one is circle and the other is square, both images background color is transparent, i want to allow the user to move these to images above each other freely..


    how to do it??
    do i need just 2 pictureboxs?? and how to drag them??


    thanks..
    ¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸

    (¯`·.¸¸.·´(¯`·.¸l VB-Sultan l¸.·´¯)`·.¸¸.·´¯)

    `·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: Layers of Images

    Originally posted by VB-Sultan
    Hi..

    i want to move two layers of images (like photoshop) above each other..

    for example.. suppose i have two images, one is circle and the other is square, both images background color is transparent, i want to allow the user to move these to images above each other freely..


    how to do it??
    do i need just 2 pictureboxs?? and how to drag them??


    thanks..
    eeh I've done that before umm what I did was that I drew the two shapes in one picturebox. Each shape had an object associated with it which held the drawing region in a variable (you need to know this for hit testing). when the user clicks on the picturebox, you just have to go through all the shapes that you have and do a hit test on all of them.
    say you have a GraphicsPath object called p that represents your circle. Then to do a simple hit test you would just call p.IsVisible (adjustedMouseX, adjustedMouseY). The first shape that succeeds the hit test was the one clicked (then you have to have the shapes in order in an array or something to make sure you get to hit-test the top-most shape first)
    eeh kinda gives you the idea, but I know I'm saying it really vague and incompletely
    Last edited by MrPolite; Apr 1st, 2004 at 02:48 AM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2001
    Posts
    71



    thanks for responding MrPolite..
    if u clarify by coding it will be more understood..
    ¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸

    (¯`·.¸¸.·´(¯`·.¸l VB-Sultan l¸.·´¯)`·.¸¸.·´¯)

    `·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`·.¸.·`

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by VB-Sultan



    thanks for responding MrPolite..
    if u clarify by coding it will be more understood..
    uuh I had 5000 lines, I cant code it that easy
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

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