procedure TForm1.FormCreate( Sender: TObject );
begin
ImageEnView1.EnableAlphaChannel := True;
ImageEnView2.EnableAlphaChannel := True;
ImageEnView1.IEBitmap.AlphaChannel.Location := ietbitmap;
ImageEnView1.EnableAlphaChannel := True;
ImageEnView1.IO.Params.Bmp_HandleTransparency := True;
ImageEnView2.IEBitmap.AlphaChannel.Location := ietbitmap;
ImageEnView2.EnableAlphaChannel := True;
ImageEnView2.IO.Params.Bmp_HandleTransparency := True;
end;
procedure TForm1.Button1Click( Sender: TObject );
begin
// paste to the clipboard
ImageEnView1.Proc.SelCopyToClip;
// if clipboard contains data valid for TImageEnProc
if ImageEnView2.Proc.IsClipboardAvailable then
begin
// assuming X,Y = mouse coordinates, makes all colors the area transparent
// tolerance specifies the maximum difference from the starting pixel
ImageEnView2.Proc.CastAlpha( ImageEnView2.SelX1 + 1, ImageEnView2.SelY1 + 1, 0, 15 );
// paste the contents of the Clipboard inside the ImageEnView2 selected area
ImageEnView2.Proc.SelPasteFromClip( );
ImageEnView2.Update;
end;
end;
If this does not work are you positive that both images are 32-bit?
Is:
ImageEnView1.IO.Params.BitsPerSample = 8;
ImageEnView1.IO.Params.SamplesPerPixel = 4;
ImageEnView2.IO.Params.BitsPerSample = 8;
ImageEnView2.IO.Params.SamplesPerPixel = 4;
William Miller