Image in LeftMargin

General TRichView support forum. Please post your questions here
Post Reply
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Image in LeftMargin

Post 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
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This demo uses BackgroundBitmap.
Besides, you can use TRichView.OnPaint or custom drawing items of TRVStyle.
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
jnap
Posts: 31
Joined: Sat Sep 30, 2006 6:23 pm

Post 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
Post Reply