Mike Malinowski
How to use three or more bmp images on top of each other.
By Mike Malinowski in GDI+ on Dec 29 2008
  • Mike Malinowski
    Dec, 2008 29

    I am trying to use 3 or more images on top of each other (the top two being transparent). As I understand, the Picture box can only take two at any given time (counting the background). I then tried to load them into a panel (not using a picture box), with the hope of using the automatic scrollbar option. I was able to load the images perfectly but cannot get the scrolling option to work. I was loading the images in the panels on paint sub. The images are large and will require scrolling.

    Here is an extract of the code:

    wBmpWidth = Panel1.Width

    wBmpHeight = Panel1.Height

    bmp = Bitmap.FromFile("C:\Documents and Settings\Admin\My Documents\My Pictures\TransparentPic.bmp")

    bmp.MakeTransparent(Color.White)

    bmp2 = Bitmap.FromFile("C:\Documents and Settings\Admin\My Documents\My Pictures\TransparentPic2.bmp")

    bmp2.MakeTransparent(Color.White)

    bmp3 = Bitmap.FromFile("C:\Documents and Settings\Admin\My Documents\My Pictures\TransparentPic3.bmp")

    bmp3.MakeTransparent(Color.White)

    g = e.Graphics

    g.DrawImage(bmp, 0, 0)

    g.DrawImageUnscaled(bmp2, 0, 0)

    g.DrawImageUnscaled(bmp3, 0, 0)

    Panel1.AutoScroll = True

    Panel1.AutoScrollMinSize = bmp.Size

    anyone could make a suggestion, offer advice or point me to sample code I would be extremely gratefull

     

    Regards Mike

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS