trichview.com

trichview.support




Re: HTML WYSIWYG and images


Return to index


Author

Message

James Crosswell

Posted: 02/16/2005 18:36:06


James Crosswell wrote:

> However, lines 2136 through 2155 of the rvhtmlimport.LoadHtml method

> read as follows:

>

> (**************************< snip >**************************)

> TmpStyle := rvsPicture;

> Link := 0;

> if (CurrLink <> '') then

> begin

>  RemoveLineBreaks(CurrLink);

>  if rvhtmloBasePathLinks in Options then

>    CurrLink := GetFullFileName(CurrLink);

>  if (rvhtmloAutoHyperlinks in Options) and (rvoTagsArePChars in

> RichView.Options) then begin

>    Link := integer(StrNew(PChar(CurrLink)));

>    TmpStyle := rvsHotPicture;

>    end

>  else begin

>    RVData.ReadHyperlink(CurrLink, '', rvlfHTML, TmpStyle, Link, ts2);

>  end;

> end;

> GraphicItem := CreateRichViewItem(TmpStyle, RVData) as TRVGraphicItemInfo;

> GraphicItem.Tag := Link;

> GraphicItem.Image := gr;

> GraphicItem.ParaNo := GetCurParaNo;

> RVData.AddItem(ts2, GraphicItem);

> (**************************< snip >**************************)

>

>

> So the way I read this is that the Tag value of a GraphicItem will ONLY

> have a value if the image is surrounded by a Link and in that case the

> tag will contain the value of the hyperlink - not of the image location

> itself... As such, the original image location is currently not being

> stored and there is currently no way to retrieve this during the

> SaveItemToFile event handler of the RichView component... I could

> replace the Tag for the GraphicItem with the location of the image, but

> that means that hyperlinks for images would be broken in HTML documents

> that I opened/saved using the RichView component.


Although I appear to be having a conversation with myself - I may as

well finish it. I eventually managed to do what I wanted. I had to

modify the code for the rvhtmlimport.LoadHtml procedure to save BOTH

Link AND the ts2 (as a comma separate list) into the the

GraphicItem.Tag... then in the OnSaveItemToFile and OnWriteHyperlink

functions I extract either/or/both as need arises.


A FileName property or something in the GraphicItem class would be quite

useful though.


Best Regards


James Crosswell





Powered by ABC Amber Outlook Express Converter