Pictures don't merge

  • Hi,

    I have a problem with pictures in WPRichText.

    I'm adding pictures like that :

    Code
    if(TOpenPictureDialog1->Execute())
    {
    	doc->SetFocus();
    	TWPTextObj *txtObj = doc->Memo->RTFData->TextObjects->Insert(WPLoadObjectFromFile(doc->Memo->RTFData,TOpenPictureDialog1->FileName, false), 0, 0, "Pic", "Stream");
    
    
    	txtObj->Wrap = wpwrBoth;
    	txtObj->PositionMode = wpotPar; 
    }

    But when I merge my document, the picture disappear. Instead, there is a white square with red borders.
    I was wondering, is there any special methods to call when you merge a document with pictures in it?

    Thanks

    Einmal editiert, zuletzt von Lilly (29. Mai 2009 um 10:51)

    • Offizieller Beitrag

    Hi,

    I would first try to assign the TWPObject to a variable. Only then you can know if the image was loaded at all. Is the file name is ok, is the image format supported?

    By standard only BMP, JPG and EMF will work.

    PNG need to be activate in wpobj_image.pas. You need the PNGImage library to make it work

  • I had nearly the same problem.
    I solved it this way:

    Code
    TWPObject* wpobj;
    wpobj = WPLoadObjectFromFile(wptDoc, OPDImage->FileName, true);
    wptDoc->TextObjects->InsertMovableImage(wpobj);