News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Transparent Background image in RichEdit (2 Examples) - Update 28/08/2.012

Started by guga, August 28, 2012, 12:57:43 AM

Previous topic - Next topic

guga

1st Small Example of a semi-transparent background image inside a richedit control.

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

Example1: V 2.0 - Updated Version 16:48  27/08/2.012 - Fixed Mousewheel

Updated Version at 14:52 27/08/2.012 - Fixed invalidating desktop


Example2 28/08/2.012 - This one is really inserting a image inside the richedit control



Next Version. - I´ll try to adapt Iczelion Example 35 to this.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

qWord

Not that good: it invalidates the whole desktop when typing text.
You may also take a look at DWM.
MREAL macros - when you need floating point arithmetic while assembling!

guga

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
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

qWord

MREAL macros - when you need floating point arithmetic while assembling!

guga

Seems great, but, i don´t have vista here.

Does it have something similiar in XP ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

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 ?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

I found these but seems useless here
http://www.vbforums.com/showthread.php?352814-RESOLVED-Capture-Scroll-Event-of-RichTextBox
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Updated Version at 16:38 27/08/2.012 - Fixed mousewheel scroll
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Other example. This time using really a image inside a richedit.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

dedndave

i am still trying to figure out where the scroll bar is   :lol:

guga

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.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

TouEnMasm

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.
Fa is a musical note to play with CL

TouEnMasm

I have put it at a better place than before.
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.

Fa is a musical note to play with CL

TouEnMasm

If the method exposed here work:
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.
 
Fa is a musical note to play with CL

TouEnMasm


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.




Fa is a musical note to play with CL