views:

148

answers:

1

i am new to this core graphics or cv . I need a little help here. Can you plz guide me how to draw an image using openGL ES with my own cordinates or any other idea...

consider my points are topleft (40,160) topRight(80,160) bottomLeft(0,40) bottomRight(160,40)

i want my image to be drawn with in these points..... Plz help me... i will be really thankful to you guys....

A: 

You need to load your image into an OpenGL texture and then display the texture at the vertices you specify. Note that the texture width and height needs to be a power-of-2, so you'll have to pad the margins and adjust your vertices to get the correct placement if the image is not power-of-2. Apple has a great example of this in the GLSprite sample code.

jeff7
great but is it possible to do the same task without using OPENGL, I have seen some techniques that mask the image according to the mask.png provided... but that cuts the image i dont want my image to be cut instead i want it to fit in the region provided in my mask.png....
yunas