habe ein bild aus einer datenbank-tabelle (dbisam) mit einem dbisamquery in eine TDBImage Komponente geladen, es wird dargestellt, lade mit folgendem Code:
dbisamquery2.SQL.Text:='select image from artplan where artigo='+quotedstr(trim(artikel.Text));
dbisamquery2.ExecSQL;
will es aber dann in ein pdf-format ausdrucken mit:
printpdf1.ImageOut(100,100, dbimage1.picture.bitmap);
bekomme dann aber die Meldung:
[Fehler] AknUni.pas(267): Inkompatible Typen: 'TImage' und 'TBitmap'
Tim Young von Dbisam hat mir dies gemailt:
This is really an issue for the TPrintPDF vendor, but you should be able to
cast the TDBImage to a TImage to get the desired result (TDBImage descends
from TImage)
Habe dann noch probiert:
Image:=TImage.Create(dbimage1);
Image.Picture.Bitmap.Create;
printpdf1.ImageOut(100,200,TImage(Image));
konnte kompilieren, aber bei der Anwendung kam die Meldung:
konnte dann auch kompilieren, bekam dann aber die fehlermeldung:
Exception EInvalidGraphic, Bitmap ist ungültig.
Verweis auf meine externe tnpdf-unit, mit der ich das pdf-File herstelle, dabei ist die letzte Zeile beim Fehler markiert, die heisst:
SetBitmap(ABitmap.Picture.Bitmap);
wer kann helfen?