i am newbie 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.....
and 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.... without losing any data
well I have worked on some other projects but this is my first time dealing with images in that much detail
the masking i was asking about, you can see it here How to Mask an Image
i have gone through the links you have snt me but i have solved the problem using the textures
this wuld be a really creepy code but as if you are master in image processing then i believe you can easily under stand how i have dealt with the world window and my window in this code.... any ways thnx alot 4 ur help and time
I guess I still don't understand your question and what your needs are.
Does it have to be OpenGL, or is UIKit ok? Are you trying to bend the the image into some other four-sided shape like a trapezoid, or are you trying to mask it inside another image, like cutting it into a puzzle piece?
i guess i am really bad at explaining ...
well being more simple and precise
i want my image to be drawn in an irregular shape.
The whole image will reside in that shape without losing any data...
for example
i decide a region i.e.
Left top (0,0)
left bottom (0,100)
Right top (250,0)
Right bottom (330,320)
these four points will make a shape that will be irregular shape.
now i want my image to be drawn in that region/shape.
and i want to know both ways i.e. in opengl and uikit
The OpenGL method is simpler, if you have openGL set up already. Just create two triangles that cover the area you want; no transformations needed. Just remember to put the vertices in the correct order:
Judging from those coordinates, you have openGL set up with a very small coordinate system. When doing 2D work I would change your GL view setup so that you can enter coordinates in pixels; they you can just plug your coordinates into that array.
wow.... that seemed pretty amazing but I am not able to implement it.
These all points and coordinates thing jst passed over my head.
I will be really thankful to you if you can provide me sourcecode of Xcode that is actually implementing it.
Did you succeed?
I am trying to apply the technique of stackoverflow, without success...
I would like to find the way to transform a CAlayer defined by a CGRect, to a quadrilateral defined by four points (x1,y1)(x2,y2)(x3,y3)(x4,y4)
Did you succeed?
I am trying to apply the technique of stackoverflow, without success...
I would like to find the way to transform a CAlayer defined by a CGRect, to a quadrilateral defined by four points (x1,y1)(x2,y2)(x3,y3)(x4,y4)
Hi Guit
well mate i had an image and i had an irregular shape and i wanted to draw that image into that irregular shape.
for me it seems not to pass the center x and y instead pass the screen portion/coords (x,y,w,h) you want to crop and then skew.
Ah, i just went through the blog where this code was posted...
Well for you, http://iphonedevelopment.blogspot.co...part-6_25.html
try this blog... It will teach/guide you on how to blend an image... plus the author has pasted his code as well...
Happy coding
Quote:
Originally Posted by sindhutiwari
I need to crop a image into irregular shape and deskew .
I have used this
Can some one please tell me the parameters which i need to pass here .. i mean to say what is X and Y here ??
i have passed center.x and center.y of the image and it resulted in a blank screen.