Layer.convertType

Function/Meaning

Layer image representation format conversion

Type
Layerclassmethod of
Syntax
convertType(from)
Arguments
from

Specify the drawing method type to be converted.

Return value
None (void)
Explanation

Converts the format of layer images.
This method converts the image representation format between "types that have different layer image representation formats but can be represented in the same way", such as ltAlpha (dfAlpha) and ltAddAlpha (dfAddAlpha).
For example, if you change the layer type displayed by ltAlpha to ltAddAlpha as it is, it will not be displayed properly because the alpha channel and color information are handled differently.
Therefore, you need to use this method to convert from dfAlpha to dfAddAlpha.
Note that in this method, the image representation format of the conversion destination corresponds to the drawing method specified by the Layer.face property (not the layer type specified by Layer.type, but the drawing method. ).
In the from argument, specify the drawing method (constant starting with df; see Layer.face) corresponding to the image representation format of the conversion source.
You cannot specify dfAuto for the from argument.
Currently supported conversions are dfAlpha → dfAddAlpha and dfAddAlpha → dfAlpha conversions. In dfAddAlpha → dfAlpha, color information may be lost due to conversion.
This method is unaffected by the drawing clip rectangle (always the entire layer image is affected).