iDevGames Forums
zoom out is not working on pictures ! - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: zoom out is not working on pictures ! (/thread-1954.html)



zoom out is not working on pictures ! - imaumac - Jan 5, 2009 10:41 AM

Hi, i have a small problem with zoom out (with pictures jpg)
i will put a button code here, maybe is there some suggestion to fix it please.
i need help with this please.

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after application launch
    
    VISTA1.contentSize = CGSizeMake(405, 605);
    VISTA1.maximumZoomScale = 3.0;
    VISTA1.minimumZoomScale = 1.0;
    VISTA1.clipsToBounds = YES;
    VISTA1.delegate = self;
//    [VISTA1 addSubview:IMAGENZOOM];
    [window makeKeyAndVisible];
    [window addSubview:PANTALLA];
//    [PANTALLA addSubview:VISTA1];

}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
    [IMAGENZOOM center];
    return IMAGENZOOM;
}
-(IBAction) PULSAR_BOTON1: (id) sender
{

    [IMAGENZOOM removeFromSuperview];
    [VISTA1 setBouncesZoom:NO];
    VISTA1.contentSize = CGSizeMake(1.0f, 1.0f);
    VISTA1.contentSize = CGSizeMake(320.0, 380.0);

    IMAGENZOOM.image = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"image2" ofType:@"jpg"]];
//    VISTA1.contentSize = CGSizeMake(IMAGENZOOM.image.size.width*0.5,
//                                    IMAGENZOOM.image.size.height*0.5);
    IMAGENZOOM.frame = CGRectMake(IMAGENZOOM.frame.origin.x,
                                  IMAGENZOOM.frame.origin.y,
                                  320.0,
                                  380.0);
    
    [VISTA1 addSubview:IMAGENZOOM];
    
    
}