阅读背景:

关于图像的Alpha值的问题

来源:互联网 
  // Make half-transparent grey, the background color for the layer
   UIColor *Light_Grey 
      = [UIColor colorWithRed : 110/255.0 
                        green : 110/255.0 
                        blue  : 110/255.0 
                        alpha : 0.5];

  // Get a CGColor object with the same color values
   CGColorRef cgLight_Grey = [Light_Grey CGColor];
   [boxLayer setBackgroundColor : cgLight_Grey];

  // Create a UIImage
   UIImage *layerImage = [UIImage imageNamed : @"Test.png"];

  // Get the underlying CGImage
   CGImageRef image = [layerImage CGImage];

  // Put the CGImage on the layer
   [boxLayer setContents : (id) image];
  // Make half-transparent grey, the background



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: