Friday 22 June 2012

Change Image Size With Slider and Also with Max value To Min Value(Opposite Direction Logic )


Here in my app Big To Small Slider Image Display so i create bellow logic and complete the work...
In Bellow Method i zoom in and zoom out the Image with Slider....

-(IBAction)scaleOfImage:(id)sender{

    float finalval,fixfinal;
    if (sldBigSmall.value<500) {
        finalval=500-sldBigSmall.value;
        fixfinal=500+finalval;
    }
    else if(sldBigSmall.value>500){
        finalval=sldBigSmall.value-500;
        fixfinal=500-finalval;
    }
    else{
        finalval=500;
    }
    
    if (boolimgplant) {
        

        imgplant.frame=CGRectMake(imgplant.frame.origin.x, imgplant.frame.origin.y, fixfinal, fixfinal);
        [imgplant setCenter:CGPointMake(500, 300)];
    }
    else if(boolimgpot){
        imgpot.frame=CGRectMake(imgpot.frame.origin.x, imgpot.frame.origin.y, fixfinal,fixfinal);
        [imgpot setCenter:CGPointMake(500, 400)];
    }
}

No comments:

Post a Comment