Advertisement

02.02.2007 at 02:54PM PST, ID: 22147785
[x]
Attachment Details

Draw Image Slightly off Screen using glDrawPixels

Asked by Xavior2K3 in OpenGL Graphics & Game Programming

Tags: gldrawpixels, draw, image

Hi,

If i have an image (100x100) and i want to draw it slightly off of the screen, how can i do this using glDrawPixels? I have tried calling gl.glRasterPos2i(-50, 0) but this doesn't work. It overlaps fine on the top or right of the window but not the left or bottom (x=0 & y=0).

Also, I'm not sure if its a similar answer to the previous question, but how can you get a sub image of an image? For example, if i have a Byte array of an image, how can i get another Byte Array containing the pixels from position (20, 20) size W=10, H=10 from the original image?

Thanks,
MichaelStart Free Trial
 
Loading Advertisement...
 
[+][-]02.14.2007 at 11:10AM PST, ID: 18534273

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: OpenGL Graphics & Game Programming
Tags: gldrawpixels, draw, image
Sign Up Now!
Solution Provided By: InteractiveMind
Participating Experts: 1
Solution Grade: A
 
 
[+][-]02.16.2007 at 07:28AM PST, ID: 18549105

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32