iphone - Changing alpha value on top and bottom parts of UIImageView -


i'm picking photo photo albums, able following it:

  1. change alpha value of top , bottom parts (lets 20 pixles top , 20 pixles bottom) 0.5

  2. then copy unchanged part in middle , assign uiimageview

i've got code:

@synthesize imageview, croppedimageview, choosephotobtn, takephotobtn;  -(ibaction) getphoto:(id) sender {     uiimagepickercontroller * picker = [[uiimagepickercontroller alloc] init];     picker.delegate = self;      if((uibutton *) sender == choosephotobtn) {         picker.sourcetype = uiimagepickercontrollersourcetypesavedphotosalbum;     } else {         picker.sourcetype = uiimagepickercontrollersourcetypecamera;     }       [self presentmodalviewcontroller:picker animated:yes]; }    -(void) imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info {     [picker dismissmodalviewcontrolleranimated:yes];     [picker release];     imageview.image = [info objectforkey:uiimagepickercontrolleroriginalimage];           /* here want change alpha value of top , bottom parts */         /* copy unchanged part assign image value of croppedimageview */  } 

i think best way achieve use mask image. can find example on blog post : http://iosdevelopertips.com/cocoa/how-to-mask-an-image.html


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -