Page 1 of 1

Image in LeftMargin

Posted: Sun Jul 22, 2007 10:06 am
by jnap
How is it possible to insert an Image in the LeftMargin of TRichViewEdit, like the one in the Actiontest Demo?

Many thanks

jnap

Posted: Sun Jul 22, 2007 11:34 am
by Sergey Tkachenko
This demo uses BackgroundBitmap.
Besides, you can use TRichView.OnPaint or custom drawing items of TRVStyle.

Posted: Sun Jul 22, 2007 12:59 pm
by jnap
Hi,

Thank you for your reply, but I still don't have any idea how to do this?

I need the image to be just in the Margin on the Left hand side, sorry if this is a simple stupid question but i really have no idea where to start?

Could you perhaps show me some example code so i get an idea?

many thanks

jnap

Posted: Sun Jul 22, 2007 1:55 pm
by Sergey Tkachenko
In the ActionTest demo, background image fills the whole editor window. This image is very wide, but noticeable drawing is only in the left side of this image. It makes the effect that the image is only on the left margin, but it's not true for this demo.

TRichView.BackgroundStyle property allows placing background bitmap in several locations, including top left corner (bsTopLeft).
You can create a background image with large height, width = LeftMargin and place it in the top left corner. But it will not be scrolled together with document.

Posted: Sun Jul 22, 2007 5:43 pm
by jnap
Thank you for replying,

I think i will just leave the Margin as it is then.

I have just One more question:

Can Line Numbers be displayed in the Margin?

Many thanks

jnap