[MonoTouch] Image Layers and Editing
Miguel de Icaza
miguel at xamarin.com
Fri Dec 23 09:34:44 EST 2011
Hello,
I have a client that is looking to created "pages" of pictures where an
> image
> is shown through another layer. For instance you have a white square with a
> circle cut in it and the image in under the white square and the picture
> shows through the circle cut out. How can I offer the ability to cut and
> crop the photo and preview the result in the scenario listed above.
>
There are many options to do this.
You could create a UIView that provides its own Draw method, and in the
draw method, you draw the rectangle, and then use a clipping path for a
circle and draw the image on top of it.
Another option would be to create an image with the rectangle that has a
transparent hole with the circle in the middle. Then add your image to
the view, and then add this image with the hole on top of it.
UIImageView image = new UIImageView (UIImage.FromFile ("image.png"));
UIImageView rectangleWithHole = new UIImageView (UImage.FromFile
("imageWithHole.png"));
view.AddSubview (image);
view.AddSubview (rectangleWithHole);
Miguel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20111223/d431048a/attachment-0001.html
More information about the MonoTouch
mailing list