Convert the image to 32-bit with transparency and save as png:
procedure TForm1.ConvertTo32Bit;
var
iRGB: TRGB;
begin
if Assigned(PageControl1.ActivePage) then
begin
ImageEnView := TImageEnView(PageControl1.ActivePage.Controls[0]);
if Assigned(ImageEnView) then
begin
ImageEnView.Proc.SaveUndo('Convert to 32-Bit ' + IntToStr(ImageEnView.Proc.UndoCount));
Undo1.Hint := ImageEnView.Proc.UndoCaptions[0];
Undo1.Enabled := ImageEnView.Proc.CanUndo;
ImageEnView.EnableAlphaChannel := True;
iRGB := ImageEnView.IEBitmap.Pixels[0, ImageEnView.IEBitmap.Height - 1];
ImageEnView.Proc.SetTransparentColors(iRGB, iRGB, 0);
ImageEnView.BackgroundStyle := iebsChessboard;
ImageEnView.IO.Params.BitsPerSample := 8;
ImageEnView.IO.Params.SamplesPerPixel := 4;
ImageEnView.IEBitmap.Modified := True;
ImageEnView.Update;
ImageEnMView1.SetIEBitmapEx(ImageEnMView1.SelectedImage, ImageEnView.IEBitmap);
ImageEnMView1.MIO.Params[ImageEnMView1.SelectedImage].BitsPerSample := 8;
ImageEnMView1.MIO.Params[ImageEnMView1.SelectedImage].SamplesPerPixel := 4;
ImageEnMView1.Update;
end;
end;
end;
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development