Herd Software Entwicklung
DaVinci Grafikbibliothek
DaVinci Dokumentation
Schnelleinstieg mit TImage-Komponente{ Show the picture with the given File-Name }
procedure TDavForm.ImportPictureUsingDaVinci(FileName : String);
var szFileName : Array[0..128] of char;
hdb : THandle; { Handle of the imported DIB }
hMetafile : THandle; { Handle of the imported Metafile }
Resolution : METARESOLUTION; { Informations about metrics sizes of a Metafile. }
ipErr : Integer; { DaVinci - Errorcode Variable }
const WmfPointSize : TPoint = ( x:96; y:96 ); { Bitmap-Größe bei WMF-Import }
Begin
{ ------------ DAVINCI-Bibliothek für Dateikonvertierung benutzen ----------- }
strpcopy(szFileName, FileName);
hdb := 0;
hMetaFile := 0;
ipErr := ipImportExt(
@hdb, { Zieladresse für die DIB }
@hMetaFile, { Zieladresse für den Metafile. }
szFileName, { Dateiname vom User erfragen }
{ IPF_FILEDIALOG or } IPF_MSGBOX or IPF_DIB or IPF_META, { Fehler selbst melden, beide Datenformate }
NIL, { Keine CallBack-Funktion }
IPT_SELECT, { Dateiart vom User wählen lassen }
Handle, { Eltern-Fenster für Dialogbox }
@WmfPointSize, { Bitmap-Größe bei WMF-Import }
@Resolution, { Größenangaben für Metafile. }
0);
if (ipErr = IPE_OK) then { Gab's was zu lesen ? }
Begin
{-------------- Fenstertext ändern -------------------------- }
Caption := 'DaVinci Example '+StrPas(szFileName);
if (hdb<>0) Then { Eine DIB wurde gelesen }
Begin
{-------------- Neue DIB in die TImage-Komponente kopieren --------------- }
ShowNewDib(hdb);
End
else
if (hMetaFile<>0) then { Ein Metafile wurde gelesen }
Begin
{-------------- Place the new MetaFile in the Form ---------- }
ShowNewMetafile(hMetaFile, @Resolution);
End
End;
End;
Delphi 1.0 Anwender: Beachten Sie auch die Unit GETDIB.PAS und das Beispiel GETTEST.PAS. Sie zeigem wie DIB-Daten im Pascal-Anwendungsprogramm angesprochen werden.