Broken image link?

  • Quick stupid question (seems I saw this somewhere, but can't find it now)...

    What determines what is presented if an image from an image link is not found?

    I have a case where the editor shows nothing, but print preview shows a red box (with 5.20.2 it was a red box with an X in it, now it is just a red box with 5.20.5). I'd like to have it show a red box (or a red box with an X preferrably) in all cases.

    WPTools 5.20.5
    Delphi 7

    • Offizieller Beitrag

    Hi,

    in WPObj_Image.PAS:

    procedure TWPOImage.Paint(
    toCanvas: TCanvas;
    BoundsRect: TRect;
    ParentTxtObj: TWPTextObj;
    PaintMode: TWPTextObjectPaintModes);
    ...

    There you can add code which paints the rectangle in case the Graphic is nil or empty.

    Julian

  • I'm not really asking what code I can modify (to much to deal with when upgrading WPTools later)... but rather I was wondering where or why a broken image link now only displays a red bounding box rather than the historical red bounding box with an X through it?

    Again, 5.20.2 and earlier had the X'd bounding box, but 5.20.5 only has a red bounding box, as seen in print preview.

    **Update: playing around, I have another WPRichText that I had in my program, and if I delete the image referenced by the link, I get the X'd bounding box! So what determines 1) no bounding box, 2) empty bounding box, 3) X'd bounding box???????

    My other question is that since my print preview shows a bounding box, but my WPRichText editor does not (each are different WPRichText controls.. the preview is a composite of several WPRichText's) I thought maybe I was missing a property somewhere that isn't obvious to me even though I've compared the two.

    Any thoughts other than modifying released code? I can live with just a bounding box (will have to change all my documentation now), but I can't live without any kind of display in the editor. Thought you might now off the top of your head what the property I'm overlooking is.

    Thanks,

  • Ahhh... found one difference... Ponder this:

    If I copy one RichText to another using:
    WPRichText_Cmt.AsString := WPRichText1.AsANSIString( 'WPTOOLS' );
    I do not get the bounding box.

    If I replace the line with this:
    WPRichText_Cmt.AsString := WPRichText1.AsString;
    I get the bounding box (but no X)

    If I have two bounding boxes (both broken image links), and I select one of them, the other one gets the X. But as soon as I unselect it, the X goes away, leaving just the bounding box. Likewise if I select the other.

    Got an explanation?

  • One note I just discovered,

    This bounding box with or without the X behavior does not occur when LayoutMode := wplayShowManualPageBreaks. The X is always present.

    You see this strange behavior when LayoutMode := wplayFullLayout (as in the video I sent you).

    But as I said before, I have to load the WPRichText using AsString, not AsANSIString( 'WPTOOLS' );