Tuesday 22 January 2013

Border Color Of image type




 UIImage *green = [UIImage imageNamed:@"imageName.png"];
 UIImageView *anImageView=[[UIImageView alloc]initWithFrame:CGRectMake(x,y,w,h)];
[self.view addSubview:anImageView];
    [anImageView.layer setBorderWidth:15.0f];
    [anImageView.layer setBorderColor:[UIColor colorWithPatternImage:green].CGColor];
    [anImageView.layer setShadowRadius:5.0f];
    [anImageView.layer setShadowOpacity:.85f];
    [anImageView.layer setShadowOffset:CGSizeMake(1.0f, 2.0f)];
    [anImageView.layer setShadowColor:[[UIColor blackColor] CGColor]];
    [anImageView.layer setShouldRasterize:YES];
    [anImageView.layer setMasksToBounds:NO];
    
Note : import <QuartzCore/QuartzCore.h> and framework

No comments:

Post a Comment