开发者

Masking an ImageView onto Another ImageView

I'm trying to load a record or a cd mask onto an image view which contains the Album Cover of the currently playing song from the MediaPlayer.framework. The record looks like this 'http://cl.ly/4w1h' and the image view holding the Image View in the iPhone app has the album cover is a square. Now This is something similar to what I am trying to do:

I take the CD (http://cl.ly/4wdC) or the Record (http://cl.l开发者_开发知识库y/4w1h) and I get something like this on the iPhone [CD:(http://cl.ly/4wYB) | Record:(http://cl.ly/4wQI)]. The layers from photoshop look like this with masks. http://cl.ly/4vu4. So taking the masks and using them on the iPhone to overlay on top of the UIImageView. Is this even possible? If you have questions about my wording, let me know.


Try this in a viewController:

    UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0,0,300,220)];// or whatever size you want
[self.view addSubview:v];
UIImageView *iv_1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"FirstImage.png"]];
UIImageView *iv_2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"CD_Image.png"]];
iv_2.alpha = .5;   // play with this number between 0 (transparent) and 1.0 (opaque).
[v addSubview:iv_1];
[v addSubview:iv_2];
    [iv_1 release];
    [iv_2 release];
    [v release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜