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

Bitmap loading...

Started by Arkainium Mar 10, 2003 at 5:27 PM 7 replies 900+ views
Original Post
Arkainium
Arkainium
I''m reading about bitmap loading in tricks and it seems like overkill. He''s using _lread(), _lclose, etc. - functions that I''ve never seen in my life. And what''s worse, the demos don''t even work on Windows XP. I''ve been searching the internet for ways to load bitmaps and I''ve only come across using the Win API function LoadImage(). I could learn how to incorporate this into the bitmap loading function he writes, but I was wondering if someone could point me to a site that explains how to load bitmaps using Standard C++ file i/o. If it''s possible, I''d greatly appreciate it. Otherwise, I''ll just have to figure out the LoadImage function.
Burning_Ice
Burning_Ice
Hi

i''ve written a bmp loading/saving tutorial which you can read here: www.runicsoft.com/bmp.php
i''m using windows file io in the tutorial, but the file io is the most uninteresting thing when loading bitmaps, since it doesn''t matter at all if you use fread, _lread, ReadFile or stl functions since they all just return a bunch of bytes from the file, so you can easily exchange functions there


My Homepage
( This post was made entirely from re-cycled electrons )
marcus12024
marcus12024
Not sure what you''re developing with (windows GDI, DirectX, etc.), but I had the exact same problem(s) that you described. I too bought and read the "Tricks of the..." book and was quite upset to learn that the bitmap loading and displaying functions (especially those pertaining to DX surfaces) did NOT work for me under Windows XP. I would copy the code exactly, and it wouldn''t work. Highly frustrating.

Anyway, check this link: http://www.gamedev.net/reference/articles/article1078.asp

It explains things a little bit, but the real help is by following the link near the top of the page and downloading the "NotTetris" source code. The coder is obviously quite smart, and has some very simple and quite efficient methods for loading, copying, blitting, etc. bitmaps. Hope this helps. AND it works fine under Windows XP, and he has code for Color Keying, etc. Very helpful, IMHO.

I''m interested to know if many other people have had (are having) the same problem?



"The power is not in knowing what to do, but how to do it." -ME
Life's Short. Make Games.
marcus12024
marcus12024
By the way, if you''re just looking for a way to load bitmaps from files for using with Windows GDI, I''ve got some really simple code that I could share (seeing as it''s not really mine to begin with!).

Let me know if this would help
Life's Short. Make Games.
Arkainium
Arkainium
Nay, I was trying to find out how to do it using Standard C++ file i/o and I have. So thanks for the help everyone.

Topic Locked

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

Sign in to reply to this topic.