图片旋转(transform)出现锯齿如何解决(转)

 原文地址:

http://www.cocoachina.com/bbs/read.php?tid=84629 

 

      UIView *myView = [[UIView alloc] initWithFrame:CGRectZero];

    CGRect rect = myView.frame;
    rect.size = CGSizeMake(100.0, 100.0);
    myView.frame = rect;
    myView.center = mainScroller.center;
    myView.layer.borderColor = [UIColor whiteColor].CGColor;
    myView.alpha = 0.5;
    myView.layer.borderWidth = 3.0;
    myView.backgroundColor = [UIColor blueColor];
    [mainScroller addSubview:myView];
    [myView release];
     
    CGFloat angle = M_PI / 30.0;
    [myView.layer setTransform:CATransform3DRotate(myView.layer.transform, angle, 0.0, 0.0, 1.0)];
     
    myView.layer.shadowOffset = CGSizeMake(0, 2);//0,2
    myView.layer.shadowRadius = 3.0;
    myView.layer.shadowColor = [UIColor whiteColor].CGColor;
    myView.layer.shadowOpacity = 1.0;
    myView.layer.shouldRasterize = YES;
    myView.layer.edgeAntialiasingMask = kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge;
    myView.layer.masksToBounds = YES;
posted on 2012-03-05 17:08  心不蒙尘  阅读(3253)  评论(0编辑  收藏  举报