Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

Thread: Dynamic Mask
View Single Post
Old 03-18-2010, 05:51 PM   #11 (permalink)
tej@barbhya
Registered Member
 
Join Date: Mar 2010
Posts: 3
tej@barbhya is on a distinguished road
Smile Please help me out with the same masking (eraser) effect problem

Quote:
Originally Posted by smsawant View Post
hi flux,

i have two images which are overlaping on each other.(the way in which cards are placed on top of each other)

now if i move my finger over the top most image that portion of the image should become transparent.(opacity of that part should become 0).

i have tried following code on touch moved event to achieve this functionality which is working fine.But problem with this code is i am not getting appropriate finishing in it.
Code:
UIGraphicsBeginImageContext(frontImage.frame.size);
		[drawImage.image drawInRect:CGRectMake(0, 0, frontImage.frame.size.width, frontImage.frame.size.height)];
		CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
		CGContextSetLineWidth(UIGraphicsGetCurrentContext(),10.0);
		CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1, 0, 0, 5);
		CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x,lastPoint.y);
		CGContextClearRect (UIGraphicsGetCurrentContext(), CGRectMake(lastPoint.x, lastPoint.y, frontImage.frame.size.width, frontImage.frame.size.height));
		CGContextStrokePath(UIGraphicsGetCurrentContext());
		CGContextFlush(UIGraphicsGetCurrentContext());
		frontImage.image = UIGraphicsGetImageFromCurrentImageContext();
		UIGraphicsEndImageContext();
i does not have clear idea how can i do it?

kindly help me out or give me some pointer.

Thanks in advance
-----
Hi,
Can you please provide me the same code to mask the image. I see the above code but didn't success to implement. So please give me that code snippet, it will be great help to me for my 3 days work effort.

Thanks In Advance,
Tej
tej@barbhya is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 175,544
Threads: 94,068
Posts: 402,680
Top Poster: BrianSlick (7,989)
Welcome to our newest member, CMSLdesign
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:04 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.