Cerv36
02-15-2003, 08:55 PM
Hi,
I'm just getting my feet wet with OpenGL. And I think this problem is very easy, but I can't get it.
I have a program that displays a pixmap and some freehand drawing on top of that. I need to resize the image AND the window. I believe I have gotten the image to be bigger (I just duplicated each pixel to the element beside and below it in the array). The window size is initially the same as the image size. When I go to resize the image and window, the window gets bigger but the image is drawn on only the area originally used. It appears to redraw the image and then resize the window--with white everywhere else. The picture is bigger but it 'wraps' around on itself. I hope this make some sense, and any help is much appreciated!! This is the code I have (after I have obtained an array that is 4 times bigger than the original--2 x width + 2 x height):
glutReshapeWindow(2*imageWidth, 2*imageHeight);
glDrawPixels(imageWidth, imageHeight, GL_RGB, GL_UNSIGNED_BYTE, tmpPixArray);
copyCurrentImage();
glutSwapBuffers();
Thanks,
Bob
[This message has been edited by Cerv36 (edited 02-15-2003).]
I'm just getting my feet wet with OpenGL. And I think this problem is very easy, but I can't get it.
I have a program that displays a pixmap and some freehand drawing on top of that. I need to resize the image AND the window. I believe I have gotten the image to be bigger (I just duplicated each pixel to the element beside and below it in the array). The window size is initially the same as the image size. When I go to resize the image and window, the window gets bigger but the image is drawn on only the area originally used. It appears to redraw the image and then resize the window--with white everywhere else. The picture is bigger but it 'wraps' around on itself. I hope this make some sense, and any help is much appreciated!! This is the code I have (after I have obtained an array that is 4 times bigger than the original--2 x width + 2 x height):
glutReshapeWindow(2*imageWidth, 2*imageHeight);
glDrawPixels(imageWidth, imageHeight, GL_RGB, GL_UNSIGNED_BYTE, tmpPixArray);
copyCurrentImage();
glutSwapBuffers();
Thanks,
Bob
[This message has been edited by Cerv36 (edited 02-15-2003).]