Board index » cppbuilder » Drawing Tiled Background Image to TRichEdit

Drawing Tiled Background Image to TRichEdit

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.

 

Re:Drawing Tiled Background Image to TRichEdit


Hi, Jakob.

Quote
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

Re:Drawing Tiled Background Image to TRichEdit


Quote
"Robert Dunn" <robertd...@worldnet.att.net> wrote in message

news:3B10791D.BC026C15@worldnet.att.net...

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

Re:Drawing Tiled Background Image to TRichEdit


that's a good idea. I will try this thx.

Jakob W.

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

Quote

> "Robert Dunn" <robertd...@worldnet.att.net> wrote in message
> news:3B10791D.BC026C15@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

Re:Drawing Tiled Background Image to TRichEdit


Hi, Remy.

Quote
Remy Lebeau wrote:

> "Robert Dunn" <robertd...@worldnet.att.net> wrote in message
> news:3B10791D.BC026C15@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>

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

Re:Drawing Tiled Background Image to TRichEdit


Hi, Jakob.

Quote
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

Other Threads