Wrapping around graphics

  • Hello

    I have searched how to wrap around paragraphs and looked at the Games demo.

    I insert a graphic and also code the following to get word wrap:

    RichText.SelectedObject.Wrap := wpwrBoth;
    RichText.SelectedObject.Mode := [wpobjRelativeToParagraph];

    If I then click on the graphic it moves and positions over the text. Why does it do this?

    Also, I'm not too sure how to set the gap around the graphic. The text gets very close to it and I would like to move it further away.

    Thanks.

    Rob

    • Offizieller Beitrag

    Hi,

    Normally the wrapping should work just fine - I am using this procedure for the graphics popup:

    There is no property for a gap around the image.

    Julian Ziersch

  • Thank you Julian.

    Using your code I can get the text to wrap left and right which is what I need.

    I still have a problem when I click on the graphic to drag it. When I click it jumps in front of the text and the text closes up behind. It also moves from it's position when I click.

    Could it perhaps be the code I use to insert a graphic? I use

    obj := Editor.WPRichText1.Memo.RTFData.TextObjects.Insert(WPLoadObjectFromFile(Editor.WPRichText1.Memo.RTFData,OpenDialog1.FileName), 0, 0);


    Thanks.

    Rob.