Some questions about inserting pictures

  • Hello,

    Is there a method to know the size (in Ko) of an TWPObject ?

    I insert a picture (jpg) like that:

    Code
    TWPRichText *wptDoc;
    TWPObject* wpobj;
    wpobj = WPLoadObjectFromFile(wptDoc, "myFilePath", false);
    wptDoc->TextObjects->InsertMovableImage(wpobj);

    I would like to resize the picture until the weight is under 100ko.

    So I was thinking to reduce the height and width until the size is correct. But I don't know how to find the size of my TWPObject.


    Furthermore, I'm currently oblige to load my pictures as links ( with WPLoadObjectFromFile(wptDoc, "myFilePath", true) ). If I don't, when I merge my document, the picture disappears. Is there a way to make it work?

    I hope you can help me.

    Claire.

    • Offizieller Beitrag

    Hi,

    Changing the size of an object would noct change the size in KB. The size will remain the innitial file size of the JPEG file.

    When You use WPLoadObjectFromFile(... true) You create a link to the image. Please set the last parameter to false.

    Julian

  • Can I reduce the weight of pictures by reducing the quality?

    For my problem with WPLoadObjectFromFile, if I set the last parameter to false, I can not merge my document because pictures disappear. It's very annoying. Is there a reason why?