您好我使用CALayer()
制作了幻灯片代码,我希望在Brown
值的图像上添加alpha
颜色掩码。我的CALayer()
代码如下。
let imageLayer = CALayer()
imageLayer.contents = image.cgImage
imageLayer.anchorPoint = CGPoint.zero
imageLayer.bounds = CGRect(origin: CGPoint.zero, size: optimus)
imageLayer.position = origin
imageView.layer.addSublayer(imageLayer)
您可以在此处看到完整代码; https://github.com/Gatada/JBKenBurnsView/blob/master/KenBurns/JBKenBurnsView.swift
之间的281-286行谢谢!
答案 0 :(得分:1)
试试这样。
Sub previousslide()
With ActivePresentation.SlideShowWindow.View
.Slide.SlideShowTransition.EntryEffect = ppEffectPushRight
.GotoSlide (ActivePresentation.SlideShowWindow.View.Slide.SlideIndex - 1)
.Slide.SlideShowTransition.EntryEffect = ppEffectPushLeft
End Sub
修改:在您的修改代码中,您需要像这样设置imageLayer.backgroundColor = UIColor.brown.withAlphaComponent(0.8).cgColor //Set alpha you want
框架。
imageLayer2