Thanks for your help
The problem was the alpha channel
Its working now perfectly with 24bit. In this way:
...
TForm1 = class(TForm)
Image1: TImage; // Component Palette: additional: TImage
...
// load picture
procedure TForm1.MenuItem4load pictureClick(Sender: TObject);
var
LPicture: TPicture;
begin
if OpenDialog1.Execute then
begin
filename := OpenDialog1.Filename;
LPicture := TPicture.Create;
try
LPicture.LoadFromFile(filename);
Image1.Picture.Bitmap.PixelFormat := pf24bit;
Image1.Picture.Bitmap.SetSize(LPicture.Width, LPicture.Height);
Image1.Picture.Bitmap.Canvas.Draw(0, 0, LPicture.Bitmap);
finally
FreeAndNil(LPicture);
end;
...
// And I draw path to picture in this way and its staying there permanent
Image1.Canvas.Pen.Color:= clRed;
Image1.Canvas.Pen.Width:=5;
Image1.Canvas.Font.Size:=10;
Image1.Canvas.Line(x,y,x2,y2);
What is the best solution to remove the path from picture? Now I am reloading the original pic.
Is there any other way quicker? ex. with layers?
" you can use a separate transparent (color keyed) TBitmap for the path layer:"