Logo on image lazarus / 39-Graphics ---------------------------------------------------------------------- kernel71 · 2011-10-20 08:10 hi all, I wanted to ask how to put a logo on an image, and then save the image as a file jpg for example. I use this to put a logo on my webcam image...so every 5 minutes I have to load the webcam image and then put the logo on it and save the file jpg. Thanks...bye andrea ---------------------------------------------------------------------- fabienwang · 2011-10-20 09:33 What OS and Version and Lazarus Version are you using? Do you have already images saved somewhere from your webcam or you want to load them from webcam directly? ---------------------------------------------------------------------- kernel71 · 2011-10-20 10:19 I've Lazarus 0.9.30 with Windows XP prof. Yes, i've a file jpg saved, I load it at runtime, put the logo and save the new image as file jpg. Thanks ---------------------------------------------------------------------- T-bear · 2011-10-21 18:01 You are using TImage right? Maybe TCanvas.Draw is what you need? Create a TPicture and load the file you want in. Then use TImage.Canvas.Draw(Left, Top, TPicture.Graphic); ---------------------------------------------------------------------- kernel71 · 2011-10-26 12:47 Thanks a lot  I'll try...bye ---------------------------------------------------------------------- kernel71 · 2011-11-02 12:05 It works well.... thanks ---------------------------------------------------------------------- kernel71 · 2011-11-03 12:00 The problem now is on the font color. I have always a gray color intead black...like i write in code when i try to write with textout (and with textrect too). Code: [Select]procedure TForm1.BitBtn1Click(Sender: TObject); var   Bmp: TBitmap;   Picture1,PictureTemp:Tpicture;   rect:trect; begin   rect.Left:=160;   rect.Top:=738;   rect.Bottom:=768;   rect.Right:=276;   JPEGtoBMP(extractfilepath(application.exename)+'webcam.jpg');   myImage.Picture.LoadFromFile(extractfilepath(application.exename)+'w ebcam.bmp');   Picture1:=Tpicture.Create;   Picture1.LoadFromFile(extractfilepath(application.exename)+'logo.jpg ');   Picturetemp:=Tpicture.Create;   Picturetemp.LoadFromFile(extractfilepath(application.exename)+'temp. jpg');   Bmp := TBitmap.Create;   try     Bmp.Assign(MyImage.Picture.Bitmap);     with Bmp.Canvas do     begin       Draw(0, 691, Picture1.Graphic);    //this is ok       Draw(198, 697, Picturetemp.Graphic);  //this is ok       brush.style:=bsclear;       font.Style:=[];       Font.Size := 12;       Font.Color := clblack;       Font.Name := 'verdana'; //      textrect(rect,160,738,'-12.3 °C');       textout(160,738,'-12.3 °C');                     //the problem is here     end;         DestImage.Picture.Assign(Bmp);   finally     Bmp.Free;     Picturetemp.Free;     Picture1.Free;   end; end; procedure TForm1.JPEGtoBMP(const FileName: TFileName); var   jpeg: TJPEGImage;   bmp:  TBitmap; begin   jpeg := TJPEGImage.Create;   try     jpeg.CompressionQuality := 100; {Default Value}     jpeg.LoadFromFile(FileName);     bmp := TBitmap.Create;     try       bmp.Assign(jpeg);       bmp.SaveTofile(ChangeFileExt(FileName, '.bmp'));     finally       bmp.Free     end;   finally     jpeg.Free   end; end; thanks ---------------------------------------------------------------------- Avishai · 2011-11-03 12:11 Did you try setting Pen.Color:= clBlack? ---------------------------------------------------------------------- kernel71 · 2011-11-04 08:31 Quote from: Avishai on November 03, 2011, 01:11:01 pmDid you try setting Pen.Color:= clBlack? Yes... In delphi5 the same code and form is ok