Anyone know how to load in jpegs with DirectDraw? I looked at directx4vb.com, but it was confusing and I couldn't get it to work. I really need this because I have a 13.5MB bitmap, and that's only the first level in my game :(
Printable View
Anyone know how to load in jpegs with DirectDraw? I looked at directx4vb.com, but it was confusing and I couldn't get it to work. I really need this because I have a 13.5MB bitmap, and that's only the first level in my game :(
simple solution, split the bitmap into categories, "most often used" and "sometimes used" and "almost never used"
Then split those into "map related, tiles, etc" and "character sprites". And load those individual bitmaps... you can have a program that packs all of these bitmaps into one file for distrubution and code in your program that unpacks them into the temp folder on the fly.
There is no way to load JPEGs into directdraw, but there is a JPEG library that will take a JPEG and convert it into a BITMAP and directdraw does take bitmaps. Also, JPEG is not the right format for game graphics, you will loose too much quality, use PNG instead, I have yet to find a VB version of a PNG library.
Search google for "AxImage", it might support both JPEG and PNG and more!!
I can't split my picture, it's my world which is used all the time. I have PhotoShop and if I set my quality to high, a jpeg has no difference from a bitmap in quality, only size. I think I'll store my jpegs in picture boxes, then when the game runs, I will make temporary bitmaps to use and when the game ends, the bitmaps will get deleted. I think that'll work.
No, do this: Put the jpeg in the picturebox using loadpicture and then use bitblt to blit it to your surface and then do that for all of the images.
How can I use bitblt to blit to a direct draw surface? That sounds wierd.
Hhahahahah, isnt that what directdraw uses? Use Lock to get the dc and bitblt to that dc. I dont remember how its done in VB but im sure someone can tell you EXACTLY how. Also, look at the documentation, it should have something like that anyways.
Is it? Never though of that, but now it come to me "BLTFAST", like duhh:). Yeh, I read up an article on that method at lucky's site.