Results 1 to 28 of 28

Thread: Transparent bitmap background - how?

  1. #1

    Thread Starter
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377

    Transparent bitmap background - how?

    I have an application which, to date, has been running on its own PC.

    Some of my customers now want to run it along side other applications on the same PC.

    I therefore no longer have the luxury of being able to set/restore desktop and regional settings on startup/shutdown.

    Everything is sorted apart from the background colours of my bitmaps. I want these to blend in with the colour of the picture box or image control on which they are displayed.

    Icons are not a problem. I use Microangelo and it has this invisible ink (?) that you can use for the background colour of an icon.

    Is it possible to do the same for bitmaps?

    I realise that I could manipulate the bitmap at run time but this seems a bit cumbersome.

    I would really like do do something like the Microangelo approach if possible.

    As always, any help is appreciated.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    You can't do it with bitmaps, try using Gif/Jpeg files instead. Otherwise you'll need to do something at run time.

  3. #3

    Thread Starter
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    Thanks for the reply,

    I was afraid that was what I was going to hear

    Looks like I've got a lot of image converting to do.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  4. #4
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    As the geek said, you can't do it with bmp files, but if you have them in pictureboxes and are going to blt them to the bacground then it will work....

  5. #5

    Thread Starter
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    Thanks for the reply NoteMe

    The images are fixed so rather than suffer the code and time overhead of bitblt at run time, I might as well convert them to a format that does support transparent background and save them in my resource file in that format.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Good luck..

  7. #7
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    JPEG doesn't support transparency btw.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  8. #8

    Thread Starter
    Hyperactive Member Simon Caiger's Avatar
    Join Date
    Aug 2000
    Location
    Rugby, England
    Posts
    377
    Thanks CornedBee,

    Lucky for me I've started converting everything to GIF and didn't decide on JPEG.
    Simon Caiger

    Documentation is like sex; when it's good, it's very, very good, and when it's bad, it's better than nothing.

  9. #9
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Oh if VB only supported PNG... =)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  10. #10
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    You could always try to make your own funtion for it...

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    He already did
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    So what is he complaining of.......just kidding...I know what he ment...

  13. #13
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    You can mask bmp's if the backgrounds are opaque colors (white, black etc)..

    Done it once, long ago :P

  14. #14
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    But then you are thinking of BitBlt arn't you....

  15. #15
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    Has been over 2 years since I last used bmp's ..
    if I recall correctly yeh, prolly blt's..

  16. #16
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    so that is what he just said that he didn't want to use...

  17. #17
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    Go for VB.NET then, it supports PNG

  18. #18
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Yes, but that would not fix his problem either. Did you read any of the posts at all???

  19. #19
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    yes I did

    and the only thing that does solve his problem is either using Gif's (which restrain him to 256 colors which looks ugly on a 32bit desktop) or use blt's on Bmp's to make it look transparent..

    (or blt's on jpg's... which does make the size a bit less)

  20. #20
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    But he don't want to use BitBlt, so the only way to go is GIF, and that is what he is doing...

  21. #21
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    So all this talking was for nothing except get a higher count in posts?

  22. #22
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    I don't care about post count. I can't understand why people are trying to get high post counts. The post counts has nothing to say about how good you are anyway....

  23. #23
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    True, it just says how 'talkative' someone is..


    actually I came by this link that gives an idea how to use PNG files in VB...

    http://www.atalasoft.com/forum/topic.asp?TOPIC_ID=578

    might be useful.

  24. #24
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190
    Ohhh...admitt it...you really didn't read all the posts did you...

    NoteMe:
    You could always try to make your own funtion for it...
    CornedBee:
    He already did

  25. #25
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    That URL isn't about creating an own function.
    admit it, you didn't read the stuff on that url forum did ya?.

    Its an object. It just does all the stuff for ya.. thus you dont have to write your own functions to put png support in VB.

    But besides that, we are rather spamming this thread with nosense... :P

  26. #26
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Yeah, he did try, but he gave it up.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  27. #27
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    This ImageLib seems to be capable of loading PNGs. But is it free?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  28. #28
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049
    You can download it here:
    http://217.158.136.10/~ultimate/cgi-...ail.cgi?ID=285 (legal link, not illegal warez stuff)

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