Image doesn't load properly

Started by
4 comments, last by Tornado 23 years, 9 months ago
When I try loading a Bitmap to the back buffer, the bitmap comes out sort of diagonal. I have no idea what''s the problem... Other bitmap''s I loaded are fine. The bitmap is 219x40, 24 bit (Converted to 16) I made the picture with Photoshop and then resaved it with PSP. Can anyone help ? Thanks, Tornado
Goblineye EntertainmentThe road to success is always under construction
Advertisement
I''ve always been told that a bitmap must be a power of 2. But maybe I''m confusing textures versus a background image. Another thing you could check is the destination blt() to see if your using the whole screen as target. Specify the same size destination as your source bitmap and see what happens.

IceFire
Yes, you are confusing Textures and Bitmaps
Bitmaps can be any size, so I guess the problem is with the bitmap...
I''ll play with PSP''s settings until I get it right
Thanks anyway

quote:Original post by IceFire

I''ve always been told that a bitmap must be a power of 2. But maybe I''m confusing textures versus a background image. Another thing you could check is the destination blt() to see if your using the whole screen as target. Specify the same size destination as your source bitmap and see what happens.

IceFire


Goblineye EntertainmentThe road to success is always under construction
"sort of diagonal" sounds like shearing, which can happen when your source and target widths do not match exactly and the image wraps wrong. And with such a wacky width of 219, that would be the first thing I''d check.

-R
Yeah, that was it.
Resizing the width to 220 made the problem go away
Thanks for the tip.
Goblineye EntertainmentThe road to success is always under construction
i'm assuming you're talking about .bmp format. Microsoft doesn't document this anywhere as far as i know but the width must be a multiple of 4 pixels i believe and and if its not a multiple of 4 it will be padded at the end of each horizontal line to make it so

So obviously you must take this into account. I believe there is some kind of cool bytewise operation you can perform that will leave numbers that are multiple of 4 as a multiple of 4 and if it isn't it will make it the next highest multiple of 4

Edited by - Theses on July 18, 2000 6:54:59 PM

This topic is closed to new replies.

Advertisement