Skip to main content
GameDev.net gamedev.net
🔒 Locked

Trouble with loading Bitmaps

Started by Nexis Feb 23, 2000 at 9:29 PM 1 replies 900+ views
Original Post
Nexis
Nexis
Ok, I'm having a little bit of a problem loading some bitmaps into a directx surface. I'm basically using the bitmap loading function from andre lamothe's books (windows game programming for dummies and tricks of the game programming gurus). Everything works fine if the width of the bitmap is divisible by 4 but otherwise I get skewing and everything appears diagonal and messed up. I initially thought this was a problem with directx surfaces (as Andre Lamothe said it was) however I'm not sure anymore. Does anyone know how to fix this problem? Or what other methods can load bitmap files that don't have this limitation? Well I got it working, there are a few extra bytes padded onto the end of each line when the width is not a multiple of 4. Edited by - Nexis on 2/24/00 1:09:00 AM
FalloutBoy
FalloutBoy
Heh, I was going to say "Yeah I know how to fix it, make sure your only load bitmaps that are multiples of 4!" It''s a byte-alignment problem.
Mike Weldon, a.k.a. FalloutBoymweldon@san.rr.com
Nexis
Nexis
Actually I was able to compensate for the byte alignment problem by skipping over the extra few bytes at the end of each line. Really simple to fix once I saw a post on the board from a few months ago that explained the problem.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.