PDA

View Full Version : reading part of a bitmap into a texture?



A05087
11-28-2002, 02:26 AM
Can anyone suggest a way to read in a part of a bitmap into a texture. The image that I'm loading is 1Gb so I can't load the whole image, as it's so big and it would slow my processes down.

I'm currently using :
AUX_RGBImageRec *texture1;
texture1 = auxDIBImageLoad("Data/bit.bmp");

Is there a auxDIB section load?

Thanks
Patrick

Gavin
11-28-2002, 02:43 AM
why not just chop it up yourself?

A05087
11-28-2002, 03:44 AM
Originally posted by Gavin:
why not just chop it up yourself?

Because its for a pathologist who will not waste time chopping up images.

Gavin
11-28-2002, 04:11 AM
I meant why don;t you write code to chop it up.... I don;t see the problem.....
pick the width/height of the txture you want to use, after checking the max size, and then after you have loaded the whole image split it up into these sizes....

A05087
11-28-2002, 04:33 AM
Gavin,

Will this not take a age to load as the whole 1Gb image will have to be loaded into RAM?


Originally posted by Gavin:
I meant why don;t you write code to chop it up.... I don;t see the problem.....
pick the width/height of the txture you want to use, after checking the max size, and then after you have loaded the whole image split it up into these sizes....

Gavin
11-28-2002, 05:07 AM
just use low level io. If it does take too long then you just read the part you need from the file. I assume you know about fseek, read (as opposed to fscanf) etc.

A05087
11-28-2002, 05:10 AM
No I have heard of that? could you explain?



Originally posted by Gavin:
just use low level io. If it does take too long then you just read the part you need from the file. I assume you know about fseek, read (as opposed to fscanf) etc.

Gavin
11-28-2002, 05:27 AM
are you using C?

A05087
11-28-2002, 05:31 AM
Using V C++ 6.0.


Originally posted by Gavin:
are you using C?

Gavin
11-28-2002, 05:42 AM
just try it the simple way to start with by reading the whole file in and the extracting the 'block' of the bmp that you need, it may be quick enough for you.

A05087
11-28-2002, 05:50 AM
Ok Cheers,


Originally posted by Gavin:
just try it the simple way to start with by reading the whole file in and the extracting the 'block' of the bmp that you need, it may be quick enough for you.