Layer.holdAlpha

Function/Meaning
Whether to protect the alpha channel
Type
Layer class property (read/write)
Description
Specifies whether to protect the alpha channel during drawing. You can also set the value.
Default is false.
In Kirikiri 2.23 beta 1 and earlier, each drawing method had a parameter called "hda" that performed the same action as this property, but it was separated into a property starting from 2.23 beta 2.
In some drawing operations, when the Layer.face property is dfOpaque, you can use this property to specify whether to preserve the image's alpha channel (mask image). For many methods, setting this property to false allows for faster drawing. If Layer.type is neither ltAlpha nor ltAddAlpha, the image's alpha channel is not used, so setting this property to false is not a problem. However, if this property is false, the alpha channel will be destroyed.

The following methods are not affected by this property:
Layer.loadImages
Layer.loadProvinceImage
Layer.setMainPixel
Layer.setMaskPixel
Layer.setProvincePixel
Layer.piledCopy
Layer.adjustGamma (Alpha channel is always protected)
Layer.doGrayScale (Alpha channel is always protected)
Layer.flipLR
Layer.flipUD
Layer.assignImages

The following methods are affected by this property:
Layer.copyRect
Layer.stretchCopy
Layer.affineCopy
Layer.fillRect
Layer.colorRect
Layer.drawText
Layer.operateRect
Layer.operateStretch
Layer.operateAffine