[Lazarus] Images in SynEdit

ListMember listmember at letterboxes.org
Thu Dec 13 18:54:18 CET 2012


On 2012-12-13 17:08, Martin wrote:
> 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.

It would be nice (instead of adding multiple lines) if I could somehow 
specify a line height (which would, obviously, be the height of the image).

Doesn't SynEdit allow for different font sizes --which I would translate 
to read as different line heights.

> 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...

OK. Even if a little elaborate, it appears it is possible. That's good news.

I'll get back to ask more when I have actually start doing the coding.

Thank you.




More information about the Lazarus mailing list