• In my editor i have the problem, if i paste an image from an other application, that i get the image shown, but in print preview or after save on load the imagedata isn't there anymore. (I only see the border of the image)
    Insert an image from file works fine.

    In the demo it works ... therefore i think i have missed some settings but didn't find which ....

    regards
    andi

    • Offizieller Beitrag

    Hi,

    You probably save your data as HTML?

    Otherwise - if you see it in the editor it must be there in the print preview, too. (Both use the same data)

    In V5.22 you can when you save HTML specify a path where the images are saved automatically, format options: HTML-imgpath:"\" for example. This will use the current path.

    I recommend to add the $define PNGLIB to the project. You will need the PNGLIB library to compile then. (info: see unit WPObj_image.pas)

    Julian

  • no, i tried to save it as WPT and RTF

    if i copy and paste the pasted image in the WPEditor again, i only get an empty frame for an image.

    i define the PNGLIB and try it again

    [edit]I am using GraphicEx (and compiled it with the compiler switch GRAPHICEX)... do i need PNGLIB ?
    [edit]for my printpreview, i made a new windows and assign the Data with AsString to a new WPRichEditor ... therefore is didn't see the image in the printpreview

  • i tried some thing, and stepped through the sourcecode (specially the PasteFromClipboard) to see the difference between a simple demo and my application.


    I pasted the identicallly image into both, my application and the simple demo.

    In the demo :

    Code
    function TWPObjectEnv.NewWPObjectFromData(  DontFreeData: Boolean;  var data: TPersistent;  var newobj: TWPObject;  var w: Integer;  var h: Integer): Boolean;...begin  ...  if data is TBitmap then  begin    ext := 'BMP';

    data is a TBitmap


    in my application

    Code
    else if data is TGraphic then
      begin

    data is a TGraphic

  • i found the problem

    i has a component Envision, for some bitmap operation
    and int he initialization section the component registers itself as Format for the CF_BITMAP

    Code
    TPicture.RegisterClipboardFormat(CF_BITMAP, TDibGraphic);

    and than the WPRichEdit, can Paste the image, the image is showed correctly, but can't save the image (neiter into file nor for clipboard)

    i have removed the RegisterClipboardFormat, and now all works as it should.