PDA

View Full Version : large bitmaps



A05087
11-18-2002, 12:01 AM
Does anyone know how to break a large bitmap into smaller bit and then display them all in one screen? Having trouble reading in large bitmap of 24000k

thanks

Gavin
11-18-2002, 01:35 AM
having trouble allocating memory or...?

A05087
11-18-2002, 09:55 AM
Originally posted by Gavin:
having trouble allocating memory or...?


I'm not sure. My program works ok with small bitmaps but when I increase the size to about 24000K it takes an age to load and when it loads the image is not in the window?

Thanks

KShots
11-18-2002, 01:30 PM
That sounds bizarre...could you tell us how you are loading this texture in? That may shed some light. Me personally, bitmaps are simple enough that I looked up the structure and read the bits in myself. This seems to handle really large bitmaps no problem, how do you do it?

A05087
11-18-2002, 11:18 PM
Originally posted by KShots:
That sounds bizarre...could you tell us how you are loading this texture in? That may shed some light. Me personally, bitmaps are simple enough that I looked up the structure and read the bits in myself. This seems to handle really large bitmaps no problem, how do you do it?


I'm using a GLuint texture[1] to store the image and the fuction is :

GLvoid CMicroscopeView::LoadGLTextures()
{
AUX_RGBImageRec *texture1;
texture1 = auxDIBImageLoad("Data/bit.bmp");
if (!texture1) exit(1);

// Create Texture
glGenTextures(1, &texture[0]);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTE R,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, 3, texture1->sizeX, texture1->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, texture1->data);

}

jebus
11-19-2002, 04:55 AM
i don't think the glaux library is supported anymore. you may be safer loading the BMP file yourself, our using an external image library like DevIL.

jebus

Gavin
11-19-2002, 05:47 AM
You are aware that there is a max texture size for your graphics card!!! use glgetintegerv to check this size.

A05087
11-19-2002, 06:31 AM
Originally posted by jebus:
i don't think the glaux library is supported anymore. you may be safer loading the BMP file yourself, our using an external image library like DevIL.

jebus
Thanks but,
What method are you talking about for loading a BMP? Also Can you use DevIL with OpenGL?

kehziah
11-19-2002, 06:54 AM
yes, you can use DevIL with OpenGL. For extreme cases I would recommend you to write your own bmp loader. BMP format is really simple (you can find information about file formats at www.wotsit.org (http://www.wotsit.org) ). Also it will help you understand how an image is stored in memory, which will be useful since you will have to break this image into several smaller images yourself.
As Gavin pointed out, an OpenGL implementation has a maximum texture size, which you can query by glGetIntegerv. This maximum texture size is probably the size you'll use for your smaller images. Remember that OpenGL only accepts textures which width & height are powers of 2.

A05087
11-19-2002, 06:59 AM
Originally posted by kehziah:
yes, you can use DevIL with OpenGL. For extreme cases I would recommend you to write your own bmp loader. BMP format is really simple (you can find information about file formats at www.wotsit.org (http://www.wotsit.org) ). Also it will help you understand how an image is stored in memory, which will be useful since you will have to break this image into several smaller images yourself.
As Gavin pointed out, an OpenGL implementation has a maximum texture size, which you can query by glGetIntegerv. This maximum texture size is probably the size you'll use for your smaller images. Remember that OpenGL only accepts textures which width & height are powers of 2.

Thank you all for your help!!!!