Einzelnen Beitrag anzeigen

Nuclear-Ping
(Gast)

n/a Beiträge
 
#3

Re: DIB aus TBitmap erstellen?

  Alt 22. Jun 2007, 10:53
Zitat:
type TBitmapHandleType = (bmDIB, bmDDB);
property HandleType: TBitmapHandleType;
Alles klar. Vielen Dank.

Hab damit noch nie gearbeitet und der Kommentar von dem "Supporter" da hat mich doch stark verwirrt: "I recommend you google for some source code examples."

Edit:
Hm, scheint nicht so einfach zu klappen.
Delphi-Quellcode:
  HsReport.OpenDoc;
  HsReport.AutoBreakMode := AUTO_BREAK_NO_LIMITS;

  tmpBmp := TBitmap.Create;
  tmpBmp.Assign (FClientData.Image);
  tmpBmp.HandleType := bmDIB;

  { // Klappt
  tmpBmp.SaveToFile ('tmp.bmp');
  HsReport.Picture(150, 150, VFREE, VFREE,
    'tmp.bmp', PIC_KEEPIMAGE + PIC_IN_FILE);
  }


  // Klappt nicht
  HsReport.PictureDIB (100, 100,
    VFREE,
    VFREE,
    tmpBmp.Handle,
    PIC_KEEPIMAGE + PIC_IN_FILE);

  HsReport.Preview;
Mit der Methode, das Bild erst auf die Platte zu speichern und dann zu laden, klappt es. Da zeigt er mir es auf der Vorschau an. Die zweite Methode jedoch funktioniert nicht. Da krieg ich nur ein leeres durchgekreuztes Quadrat, da wo das Bild sein sollte.

Edit 2:
Nach weiterem rumlesen in dem Forum scheint die Methode, die Dateien von der Platte zu laden die bessere Methode zu sein.

http://idealsoftware.com/phpBB2/viewtopic.php?t=236
Zitat:
We do not recommend to use this function, because it must hold the image always in memory. If you are using the standard Picture() method, which reads a file from disk, it can cache the image, which means it will be removed from memory if it is not displayed / printed for a longer period of time, and it will be reloaded as necessary.
Von daher hat sich das DIB-Thema für mich erledigt.
  Mit Zitat antworten Zitat