Advertisement

Small Areas of a BMP

Started by April 29, 2001 07:52 AM
2 comments, last by Sarashinai 23 years, 6 months ago
I have a BMP and it has many textures in it. I want to load only certain portions of it. How would I do that? Someone mentioned SubBitmaps but I think that was for DJGPP.
you need to know the ratios for each smaller part of the bitmap. For example:

-bmb is devided into four equal quadrants
--Texture Coords For Upper Left Quadrant
----0, 0.5
----0.5, 0.5
----0.5, 1
----0, 1

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Advertisement
I don''t really see the question, but


just in your bitmap loading code you wrote, just read the pixel you need
(you can find me on IRC : #opengl on undernet)
A common technique is to load an image-resource bitmap that contains lots of little bitmaps. It''s less overhead on DirectX since you need to load the image into a single surface, rather than creating a multitude of surfaces for each little bitmap. Then, when you need a particular bitmap, you simply BitBlt/copy out the subsection you need. This is especially good when working with rectangular or square tiles. A 256x256 bitmap image could then contain 64 tiles that are 32x32 each. Tile 0 would be at (0,0), tile 1 at (16,0), ... tile 8 at (16,0), etc..

// CHRIS
// CHRIS [win32mfc]

This topic is closed to new replies.

Advertisement