Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Drawing Tiled Background Image to TRichEdit

17 views
Skip to first unread message

Jakob Westhoff

unread,
May 26, 2001, 1:43:09 PM5/26/01
to
Hi
I hope you can help me out with this.

What need to do is to Draw a Background Image to a TRichEditControl.

I am not sure how to do this. I hope you can give me hint or some example
code.

Jakob W.

Robert Dunn

unread,
May 26, 2001, 11:48:45 PM5/26/01
to
Hi, Jakob.

Jakob Westhoff wrote:
>
> Hi
> I hope you can help me out with this.
>
> What need to do is to Draw a Background Image to a TRichEditControl.

What you need is a Rich Edit control that can have a transparent
background. AFAIK, this cannot be done with RE 1.0 (which TRichEdit
uses). You will need a control based upon RE 2.0 or 3.0. See
http://home.att.net/~robertdunn/Yacs.html for a FAQ that explains this
and additional information.

HTH.

robert

Remy Lebeau

unread,
May 27, 2001, 12:17:47 AM5/27/01
to

"Robert Dunn" <rober...@worldnet.att.net> wrote in message
news:3B10791D...@worldnet.att.net...

> What you need is a Rich Edit control that can have a transparent
> background.

How do you figure that? Looking at his post, I see no indication that he
wants a transparent background, simply to draw an image as the background.
Those are two separate issues.

Would it simply be enough to subclass the RichEdit's WindowProc and paint
the image onto the Rich Edit's canvas (with help from a TControlCanvas) in
response to the WM_ERASEBACKGROUND message? I haven't tested this yet.


Gambit


Gambit


Jakob Westhoff

unread,
May 27, 2001, 7:46:32 AM5/27/01
to
that's a good idea. I will try this thx.

Jakob W.

"Remy Lebeau" <gamb...@gte.net> schrieb im Newsbeitrag
news:3b10804e$1_1@dnews...

Robert Dunn

unread,
May 27, 2001, 9:28:20 PM5/27/01
to
Hi, Remy.

Remy Lebeau wrote:
>
> "Robert Dunn" <rober...@worldnet.att.net> wrote in message
> news:3B10791D...@worldnet.att.net...
> > What you need is a Rich Edit control that can have a transparent
> > background.
>
> How do you figure that? Looking at his post, I see no indication that he
> wants a transparent background, simply to draw an image as the background.
> Those are two separate issues.

Well, they are separate issues, albeit closely related. I made the
statement to ensure that I understood, but I do not remember ever being
asked to draw *the* background -- it was always how to *a* background.
Maybe this time is different. <g>

> Would it simply be enough to subclass the RichEdit's WindowProc and paint
> the image onto the Rich Edit's canvas (with help from a TControlCanvas) in
> response to the WM_ERASEBACKGROUND message? I haven't tested this yet.

I think that this will not work for the same reason that you cannot make
the RE 1.0 control transparent. The WM_ERASEBACKGROUND message is
definitely broken based on my lengthy attempts to use it to create a
transparent control. Kimberly Paternoster's explanation (posted on my
FAQs page) seems reasonable -- she says that RE 1.0 paints the
background in the WM_PAINT message.

robert

Robert Dunn

unread,
May 27, 2001, 9:29:44 PM5/27/01
to
Hi, Jakob.

Jakob Westhoff wrote:
>
> that's a good idea. I will try this thx.

Please let me know if this works on anything other than Win2K.

Thanks,
robert

0 new messages