I need to create a PSD file which suppose to have multiple layers and each layer needs to have a raster mask.
For raster mask I need to set mask from svg or png file as its based path.
I tried below lines but getting this error:
Invalid layer mask parameter (ImageData). Mask data bytes length should be equal MaskRectangle.Width * MaskRectangle.Height properties.
LayerMaskData layerMask = new LayerMaskDataFull(); layerMask.MaskRectangle = new Rectangle(0, 0, dto.Width, dto.Height); layerMask.ImageData = mask; layer.AddLayerMask(layerMask);
the mask is byte array which parsed from my png file.
Wondering if there is any sample exists.