Einzelnen Beitrag anzeigen

Bjoerk

Registriert seit: 28. Feb 2011
Ort: Mannheim
1.384 Beiträge
 
Delphi 10.4 Sydney
 
#7

AW: Paste "CF_JPEG"

  Alt 13. Jan 2014, 19:17
Metafile macht er aber nicht?
Delphi-Quellcode:
var
  Picture: TPicture;
  Bitmap: TBitmap;
  I: integer;
  AData: THandle;
  AFormat: Word;
  APalette: HPALETTE;
begin
  Bitmap := TBitmap.Create;
  Picture := TPicture.Create;
  try
    for I := 0 to Clipboard.FormatCount - 1 do
    begin
      AFormat := Clipboard.Formats[I];
      if Picture.SupportsClipboardFormat(AFormat) then
      begin
        AData := Clipboard.GetAsHandle(AFormat);
        APalette := Clipboard.GetAsHandle(CF_PALETTE);
        Picture.LoadFromClipboardFormat(AFormat, AData, APalette); // *** AV
        DrawPadStamp.PictureToLogo(Picture);
        Bitmap.Width := FThumbnailWidth;
        Bitmap.Height := FThumbnailHeight;
        Bitmap.Canvas.Brush.Color := clWhite;
        Bitmap.Canvas.FillRect(Rect(0, 0, Bitmap.Width, Bitmap.Height));
        Bitmap.Canvas.StretchDraw(ThumbnailRect(Picture.Width, Picture.Height,
          FThumbnailWidth, FThumbnailHeight), DrawPadStamp.Logo);
        LogoImage.Picture.Assign(Bitmap);
        Break;
      end;
    end;
  finally;
    Bitmap.Free;
    Picture.Free;
  end;
end;
  Mit Zitat antworten Zitat