|
-
Sep 29th, 2002, 11:02 AM
#1
Thread Starter
Addicted Member
Major problem, DirectDraw & Jpegs?
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
-
Sep 29th, 2002, 01:19 PM
#2
Fanatic Member
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!!
-
Sep 29th, 2002, 01:47 PM
#3
Thread Starter
Addicted Member
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.
-
Sep 29th, 2002, 01:51 PM
#4
Fanatic Member
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.
-
Sep 29th, 2002, 02:02 PM
#5
Thread Starter
Addicted Member
How can I use bitblt to blit to a direct draw surface? That sounds wierd.
-
Sep 29th, 2002, 02:08 PM
#6
Fanatic Member
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.
-
Sep 30th, 2002, 06:48 AM
#7
Thread Starter
Addicted Member
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.
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
|