WPCubed Product Support

How to Insert an Image Into a Header from a Stream

I am currently using the following code but the Image is being inserted into the body. Any help greatly appreciated:

..
WPRichText1.ActiveText:=WPRichText1.HeaderFooter.Get(wpIsHeader,wpraOnFirstPage,'');
Img:=TWPOImage.Create(WPRichText1);
Img.FileExtension:= 'jpg';
Img.LoadFromStream(BlobStream);
Img.WidthTW:=Img.ContentsWidth;
Img.HeightTW:=Img.ContentsHeight;
with WPRichText1.TextObjects.Insert(Img) do
begin
PositionMode:=wpotPar;
Wrap:=wpwrLeft;
RelX:=WPRichText1.Header.PageWidth-Img.WidthTW;
end;
WPRichText1.ActiveText:=WPRichText1.BodyText;
...

#1 ♥ 0
4.1k Views 3 users read 1 min
support

Hi,

the image is really in the header, it is only moved down and displayed under the page. This feature is usually used to create a watermark.

If you like the header to be enlarged you need to use PositionMode:=wpotChar instead of PositionMode:=wpotPar;

Julian

#2 ♥ 0

Ken,

Pardon my jump into this thread, but... [JUMP]

I might not understand your particular needs, but have you tried using WPRichText1.TextObjects.Insert(Img).rely, and setting it negative?

Fingers crossed for you,
richard diamond

#3 ♥ 0
This category is archived. No new posts are possible.