Results 1 to 7 of 7

Thread: Major problem, DirectDraw & Jpegs?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Unhappy 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

  2. #2
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    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!!
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Wink

    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.

  4. #4
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    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.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Unhappy

    How can I use bitblt to blit to a direct draw surface? That sounds wierd.

  6. #6
    Fanatic Member MoMad's Avatar
    Join Date
    Oct 2000
    Location
    Seattle, WA
    Posts
    625
    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.
    :MoMad:
    Nice Sig!

    http://go.to/momad/ Status: Not Ready

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Dec 2001
    Location
    Great White North, ey?
    Posts
    202

    Talking

    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
  •  



Click Here to Expand Forum to Full Width