MattW#11337
When using the following code to read / resize and output a PSD as a JPG, the transparent background is output as black. Is there a way to have this output as white?
Thanks,
Matt
Bitmap ModifiedBitmap = new Bitmap();
PsdReader PSD = new PsdReader(@"c:\PSDs\My.psd");
IFrame PSDFrame = PSD.LoadFrame(0);
PSDFrame.GetBitmap(ModifiedBitmap);
ModifiedBitmap.Transforms.Resize(Width, Height, InterpolationMode.Lanczos3Filter);
//Specify that we are going to save to JPEG
JpegEncoderOptions EncoderOptions = new JpegEncoderOptions(95, true);
//Save image to response stream
context.Response.Clear();
context.Response.ContentType = "image/jpeg";
ModifiedBitmap.Save(context.Response.OutputStream, EncoderOptions);
ModifiedBitmap.Dispose();
context.Response.End();
Thanks,
Matt