Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

someone2

does directDraw have problem with.........??

This topic is 5247 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello... I am having a serious problem. Does DirectDraw have problems with images whose width or height is an odd number of pixels? I am having several images. Those that are 40*40 work perfectly. but thoese that are 53*53, don''t show at all! what is going wrong! Are there any solutions? Thank you very much in advance...

Share this post


Link to post
Share on other sites
Advertisement
If you've written (or copied) a function to load bitmaps it's probably there you'll find the problem. Bitmaps are padded to 4 byte alignment in each row, which means no padding for bitmaps with a width that's evenly divisible by 4 but possibly some padding for other widths (depends on the image depth as well). MSDN describes this in more detail, but if you're not really interested, the simple solution is to read one scanline, skip 4 - (bytesperline % 4) bytes, read the next line and so on, instead of reading all of the image data in one turn.

[edited by - JakobM on January 13, 2004 1:10:26 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Endurion
Careful, 4 - (bytesperline % 4) is not correct when bytesperline is already divisible by four.


Aye, that''s right. My bad

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!