1st Small Example of a semi-transparent background image inside a richedit control.
(http://i45.tinypic.com/34yv3iq.gif)
Based on http://www.codeproject.com/Articles/11253/See-through-Rich-Edit-control
Problems:
* When you paste long text inside the richedit control and scroll up or down, the text is painted over itself (seems blurred). Don´t know how to solve yet. Maybe copying the DC somewhere or perhaps another WM_ERASEBKGND
* RosAsm can´t handle extended Dialog Styles yet.....So, i´ll rewrite this code to change the exstyle of the dialog. (This one was originated from a work of disassemblement process - All C++Classes where removed. Damn....i trully hate C++Classes :greensml:)
This is not exactly putting a image inside the background opf the RTF control, but effect seems nice.
Soon i´ll post another example of how to really insert a image as the background of a RichEdit Control.
Interesting examples on similiar subject:
http://www.codeguru.com/cpp/controls/staticctrl/datadisplaycontrols/article.php/c8829/Transparent-Static-Control.htm
Note for me:
Analyse this > http://www.codeguru.com/cpp/w-d/dislog/resizabledialogs/article.php/c1925/General-Flicker-Free-Resizable-Control.htm
http://www.codeguru.com/cpp/g-m/bitmap/article.php/c1753/Transparent-Bitmap--True-Mask-Method.htm
(http://masm32.com/board/Themes/default/images/post/clip.gif) Example1: V 2.0 - Updated Version 16:48 27/08/2.012 - Fixed Mousewheel (http://masm32.com/board/index.php?action=dlattach;topic=638.0;attach=513)
Updated Version at 14:52 27/08/2.012 - Fixed invalidating desktop
(http://masm32.com/board/Themes/default/images/post/clip.gif)Example2 28/08/2.012 - This one is really inserting a image inside the richedit control (http://masm32.com/board/index.php?action=dlattach;topic=638.0;attach=520)
(http://i45.tinypic.com/2ztdqua.jpg)
Next Version. - I´ll try to adapt Iczelion Example 35 to this.
Not that good: it invalidates the whole desktop when typing text.
You may also take a look at DWM.
Hi Qword
you mean this?
http://dwm.suckless.org
I´m reading it, but didn´t understood what does this app.
Or you are talking about this screenshot ?
http://dwm.suckless.org/screenshots/dwm-20091201.png
If it is, i´ll take a look at the code
Desktop Window Manager (http://msdn.microsoft.com/en-us/library/windows/desktop/aa969540(v=vs.85).aspx) (DWM, available since windows vista)
Seems great, but, i don´t have vista here.
Does it have something similiar in XP ?
FIXED invalidating desktop.
Now, the problem remains in the painting the control when scroll with the mousewheel.
If someone knows how to fix it, please let me know.
Why if i roll up and down the text using the scrollbar the text is ok, and when i do the samething using mousewheel and key up/down it paints the text over itself ?
I found these but seems useless here
http://www.vbforums.com/showthread.php?352814-RESOLVED-Capture-Scroll-Event-of-RichTextBox
Updated Version at 16:38 27/08/2.012 - Fixed mousewheel scroll
Other example. This time using really a image inside a richedit.
i am still trying to figure out where the scroll bar is :lol:
Since the text is smaller then the client area, the scroll will not show.
for version1 just copy and paste a large text and the scroll will show up
for version2 just keep pressing enter on the rtf edit and the scroll will also show.
A richedit with a Iricheditole interface could be of good use to change the background with an image
copy paste the image to a richedit holding the Iricheditole interface.
That all.
Some where on the forum,there is an richedit source code who do this.
I have put it at a better place than before.
http://masm32.com/board/index.php?topic=646.0 (http://masm32.com/board/index.php?topic=646.0)
Copy the image from this post and paste it to this demo program (after have initialised OLE in the menu "fichiers"
The save menu (enregistrer sous) need a litlle modify to save the image.
If the method exposed here work:
http://proger.i-forge.net/RichEdit_with_transparent_background_in_Delphi_Hell_yes/OVP (http://proger.i-forge.net/RichEdit_with_transparent_background_in_Delphi_Hell_yes/OVP)
There is just to made a transparent richedit and create a control with one image.
Play with the prioritie styles like TOPMOST or another and you wil have a good result.
Always more simple.
Here is a demo program who is near the soluce.
He allow to read a file with an image as background.
Method is simple.
give the WS_EX_TRANSPARENT style to the rich edit.
Draw the image in the windows ,paint message.
Open a file,read it,and view what happend when you press return.
The text in the upper part of the cusror is not refresh and couldn't be see until you made a scroll of the text.
Add a paint message after the return key and all will be good.
Look good guga. Thanks. :t
Hi farabi
many thanks :)
interesting. im marking this thread.
i might like to do different background colors on different lines of a control for a future project
i will keep your example in mind, Gustavo :t