Results 1 to 6 of 6

Thread: Adding Icons on top of Icons

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2

    Adding Icons on top of Icons

    Hi,

    Does anyone know how I can add an icon on top of another icon say in a grid ?

    Thanks

  2. #2
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    something like this:

    VB Code:
    1. Dim BaseImage As Bitmap = Image.FromFile("C:\Image1.bmp")
    2.       Dim OverlayImage As Bitmap = Image.FromFile("C:\Image2.bmp")
    3.       Dim g As Graphics = Graphics.FromImage(BaseImage)
    4.       OverlayImage.MakeTransparent(Color.White)
    5.       g.DrawImage(OverlayImage, 0, 0)
    6.       g.Dispose()
    Last edited by PeteD; Jul 24th, 2003 at 12:25 PM.

  3. #3
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    PeteD ,

    Use " / " not " \ " with vbcode tags (of course without quotes) .

  4. #4
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    Originally posted by Pirate
    PeteD ,

    Use " / " not " \ " with vbcode tags (of course without quotes) .
    oops cheers, have ammended it.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2003
    Posts
    2
    Thanks for your help so far.
    I have tried this but keep getting a system exception error as :
    "A Graphics object cannot be created from an image that has an indexed pixel format."

    I have tried converting the type to an image but with no luck.
    In the example your icons are .bmp files where as mine are .gif files. This may have something to do with it.
    Any more ideas ?


    Thanks

  6. #6
    Addicted Member PeteD's Avatar
    Join Date
    Jun 2003
    Location
    Sydney
    Posts
    158
    Originally posted by Ben1206
    Thanks for your help so far.
    I have tried this but keep getting a system exception error as :
    "A Graphics object cannot be created from an image that has an indexed pixel format."

    I have tried converting the type to an image but with no luck.
    In the example your icons are .bmp files where as mine are .gif files. This may have something to do with it.
    Any more ideas ?


    Thanks
    Not sure about gif's sorry.

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