Einzelnen Beitrag anzeigen

Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.685 Beiträge
 
Delphi 11 Alexandria
 
#6

AW: Text auf ein Foto speichern

  Alt 14. Aug 2018, 10:09
So in etwa habe ich es bei mir
Delphi-Quellcode:
procedure BitmapMake24Bit(const ABitmap: TBitmap);
var
  LTempBitmap: TBitmap;
begin
  if ABitmap.PixelFormat <> pf24bit then begin
    LTempBitmap := TBitmap.Create;
    try
      LTempBitmap.PixelFormat := pf24bit;
      LTempBitmap.SetSize(ABitmap.Width, ABitmap.Height);
      LTempBitmap.Canvas.Draw(0, 0, ABitmap);
      ABitmap.PixelFormat := pf24bit;
      ABitmap.Canvas.Draw(0, 0, LTempBitmap);
    finally
      FreeAndNil(LTempBitmap);
    end;
  end;
end;
Delphi-Quellcode:
  Image1.Picture.LoadFromFile('EinJpegBild.jpg');
  BitmapMake24Bit(Image1.Picture.Bitmap);
  Image1.Picture.Bitmap.Canvas.Brush.Style := bsClear;
  Image1.Picture.Bitmap.Canvas.Font.Size := 11;
  Image1.Picture.Bitmap.Canvas.Font.Color := clRed;
  Image1.Picture.Bitmap.Canvas.Font.Style := [fsBold];
  Image1.Picture.Bitmap.Canvas.TextOut(5, 5, 'Delphi-PRAXiS');
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat