|
-
May 10th, 2007, 07:31 AM
#1
Thread Starter
Lively Member
[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
-
May 14th, 2007, 03:01 AM
#2
Hyperactive Member
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
-
May 14th, 2007, 06:47 AM
#3
Thread Starter
Lively Member
Re: .bmp over .jpg
 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
-
May 14th, 2007, 06:54 AM
#4
Re: .bmp over .jpg
Are the pictures random or the same?
-
May 14th, 2007, 07:00 AM
#5
Thread Starter
Lively Member
Re: .bmp over .jpg
 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"
-
May 14th, 2007, 08:18 AM
#6
Hyperactive Member
Re: .bmp over .jpg
slot.picture = newpicture.picture
or
set slot.picture = newpicture.picture
-
Jan 4th, 2008, 02:56 PM
#7
Thread Starter
Lively Member
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
-
Jan 4th, 2008, 04:34 PM
#8
Frenzied Member
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.
-
Jan 4th, 2008, 05:18 PM
#9
Thread Starter
Lively Member
Re: .bmp over .jpg
 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
-
Jan 4th, 2008, 07:13 PM
#10
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.
-
Jan 4th, 2008, 07:19 PM
#11
Thread Starter
Lively Member
Re: .bmp over .jpg
 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
-
Jan 4th, 2008, 07:27 PM
#12
Frenzied Member
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.
-
Jan 4th, 2008, 07:52 PM
#13
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.
-
Jan 4th, 2008, 08:05 PM
#14
Thread Starter
Lively Member
Re: .bmp over .jpg
Yeah cheers Milk your way is looking the best for what i need - Many thanks
Steve
-
Jan 4th, 2008, 11:45 PM
#15
Frenzied Member
Re: .bmp over .jpg
 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.
-
Jan 4th, 2008, 11:58 PM
#16
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.
-
Jan 7th, 2008, 05:36 AM
#17
Hyperactive Member
Re: [RESOLVED] .bmp over .jpg
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|