Results 1 to 17 of 17

Thread: [RESOLVED] .bmp over .jpg

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Resolved [RESOLVED] .bmp over .jpg

    Hi All,
    Just a quick one,

    Im doing a game that uses lots of picture boxes that load from the game dir would i be better converting them to jpg's as there lots smaller or does it make no differance?

    As i dont know how to load all needed pics into the form so it dont have to load them all the time im using VB6

    Thanks

  2. #2
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: .bmp over .jpg

    Hi Fruitman,

    JPG's are compressed images, they are faster to load but as you are creating something using pictureboxes then it really makes little difference.

    Go into VB6 and click on a control, one of its properties will be image/picture. Click on the 3 dots button next to the property and you can preload a picture
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Quote Originally Posted by singularis
    Hi Fruitman,

    JPG's are compressed images, they are faster to load but as you are creating something using pictureboxes then it really makes little difference.

    Go into VB6 and click on a control, one of its properties will be image/picture. Click on the 3 dots button next to the property and you can preload a picture
    Yes i have done that they all pre load - but during the game it loads up 15 picture boxes from the HDD every second or so is this the best / fastest way to do it or is there a way to pre load them into the form so i can avoid it having to load from HDD all the time ??

    thanks for replying

    Steve

  4. #4
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: .bmp over .jpg

    Are the pictures random or the same?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Quote Originally Posted by Hell-Lord
    Are the pictures random or the same?

    yeah there random as its a slot game so every spin there loaded with the random "new images"

  6. #6
    Hyperactive Member singularis's Avatar
    Join Date
    Nov 2006
    Location
    Over There!
    Posts
    372

    Re: .bmp over .jpg

    slot.picture = newpicture.picture

    or

    set slot.picture = newpicture.picture
    If what I said was helpful, give me rep!

    My Complete Games: -- 2D Zone (Space Shooter game) || _2D Zone 2_ || Ninja Blob (2D platformer) || Dren (Co-op up to 4 player base defence game)

    My Projects: -- The Dread Engine (2D VB game Engine) || A* Path Finding


    An excellent site for learning DirectX7, 8 & 9 (for VB6, C# & VB.net) would be: directx4vb.vbgamer.com --- For my projects and games see: pieper.freehostia.com

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Hi all,

    Right the way i do it now is load all the images into picture boxes on the form.

    Then load relevent boxes from them as i need them using

    HTML Code:
    Picture27.Picture = lampG(0)
    But what i want to know is, Is it best to load these as .bmp or .jpg

    I know Jpg are smaller but dont seem to make any difference on the size of the exe after compiled.

    Someone said that i should load them as bmp as it has to handle them as bmp anyway even if there loaded as jpg is this true ??

    Steve

  8. #8
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: .bmp over .jpg

    Use the PNG file format. It is a lossless file format and has a file size around the tenth of the file size of the bitmap at the same exact quality. The .NET Framework and VB6 should have no problem loading PNG's, I believe, as they are getting to be quite standard in today's computer world.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Quote Originally Posted by Fromethius
    Use the PNG file format. It is a lossless file format and has a file size around the tenth of the file size of the bitmap at the same exact quality. The .NET Framework and VB6 should have no problem loading PNG's, I believe, as they are getting to be quite standard in today's computer world.

    Well PNG dont load in VB6 invalid format ?

    and i have found some files are actually bigger in PNG than JPEG

  10. #10
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: .bmp over .jpg

    Unfortunately Ping's require a bit of effort with VB6, which is a shame because they are a great format.

    Bitmaps although big are very close to how the image is stored in memory, so once loaded the access is very fast. You can reduce the size and load time by reducing the colour depth... the chances are you won't be able to tell any difference between 24bit and 16bit, you might even be happy with 8bit.

    Gif's might also be worth a look, maximum 8bit colours but small and VB6 is happy with them.

    I'm not a big fan of Jpegs, especially with bold bright sprites, too lossy. Also although small they can take a while to decode. It's not surprising you have found some ping files to be bigger than jpeg, ping compression is lossless.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Quote Originally Posted by Milk
    Bitmaps although big are very close to how the image is stored in memory, so once loaded the access is very fast. You can reduce the size and load time by reducing the colour depth... the chances are you won't be able to tell any difference between 24bit and 16bit, you might even be happy with 8bit.

    So basicly you dont actually gain anything by having JPEG in memory as opposed to BMP ok thats what i though / was told.

    So im better keeping them in BMP but going to 16 or 8 bit ?

    Ok i will try that many thanks

  12. #12
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: .bmp over .jpg

    Well Bitmaps load the faster because there isn't really a compression algorithm that requires processing, but because there is no compression algorithm, they take up a lot of space. JPEGs have a lousy compression algorithm, that, although reduces the size greatly, will make the image lose a lot of color and such. The PNG has one of the best compression algorithms and because of that, takes one of the longest to load but has a file size around the same as JPEG. Also, the load times aren't that differential. The PNG just may take like 20 ms longer than JPEG. It's much better to save space than loading time because the space difference, after a while, could be in hundreds of megabytes, while the load difference will just be milliseconds.

  13. #13
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: .bmp over .jpg

    All very well Fromethius but Ping's will only work in VB6 by using third party software or by decoding them manually, and as you say Jpegs look crap.

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Sep 2006
    Posts
    96

    Re: .bmp over .jpg

    Yeah cheers Milk your way is looking the best for what i need - Many thanks

    Steve

  15. #15
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: .bmp over .jpg

    Quote Originally Posted by Milk
    All very well Fromethius but Ping's will only work in VB6 by using third party software or by decoding them manually, and as you say Jpegs look crap.
    I know this isn't really helping, but why not just move up to VB .NET? They're up to version 9 now, you know. VB6 is really far behind and isn't supported at all by Microsoft I believe. I don't even think you can buy it anymore. Have you considered moving up to VB .NET? It will certainly make things a lot easier, and in my opinion, is a lot more easy to learn and use than VB6.

  16. #16
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [RESOLVED] .bmp over .jpg

    it's not easier to learn if you already KNOW basic. And of course there's the whole giant-runtime net framework issue and every version requires a different version of the framework.

    On topic: why don't you use the imagelist control to store your images in? It is, after all, what the control was designed for. You can preload as many images as you want into the control, and the only limitation is they need to all be the same size. this prevents you from cluttering up your form with unneeded picture boxes to store the images in.

    A more advanced option is creating a buffer at run-time and loading the images into it to paint from.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  17. #17
    Hyperactive Member metalmidget's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia
    Posts
    342

    Re: [RESOLVED] .bmp over .jpg

    Quote Originally Posted by Lord Orwell
    A more advanced option is creating a buffer at run-time and loading the images into it to paint from.
    That's the best option, though you would want to read this first. If you get the hang of bitblt you'll move forward in leaps and bounds from what you can do with pictureboxes. And it's not hard to get the hang of. Not hard at all
    metal

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