[Lazarus] Images in SynEdit

Martin lazarus at mfriebe.de
Thu Dec 13 16:08:39 CET 2012


On 13/12/2012 14:58, ListMember wrote:
> I am playing around with the XanaNews NNTP client, and I am 
> considering using SynEdit as it's text editor.
>
> While there are other ways of displaying images enclosed with the 
> message, it would be nice (easier for me) if SynEdit itself allowed 
> displaying these images (at the end).
>
> I don't need any fancy features such as text flowing around these 
> images or anything like that --displaying images at the end would be 
> more than good enough.
>
> Can SynEdit do this?

Not by itself.

But it has an OnPaint event, that is called after all text is painted.
You can not suppress the text, but you can paint over it, or in addition 
to it.

You need to insert the right amount of spaces, and/or empty lines to 
provide the space for your images.

When you paint you must check SynEdit.LeftChar (horizetal scroll). 
Canvas.x = 0 is always at the leftmost *visible* char (which if scrolled 
is not the first char in the line)

For the vertical scrolling, use topline and LinesInWindow. If you use 
folding, it is a bit more work. I will need to look that up...




More information about the Lazarus mailing list