Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to blur a Ctrl
Re: How to blur a Ctrl [message #48774 is a reply to message #48773] |
Wed, 13 September 2017 19:13 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
koldo wrote on Wed, 13 September 2017 18:35Hello all
I wanted to blur an area of a Ctrl, so that user can distinguish but cannot realize the details under the blurred area.
Do you know if it is possible?
A possible way would be to "mask" the Ctrl by painting small squares in void Paint(), but maybe it would be possible a more professional blurring effect.
Relatively easy way is to go through Image...
This is far from good, but to give the idea:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
struct MyApp : TopWindow {
virtual void Paint(Draw& w) {
ImageDraw iw(GetSize());
iw.DrawRect(GetSize(), White());
iw.DrawText(10, 10, "Hello World!", Arial(20));
Image m = iw;
m = Sharpen(m, -200);
m = Sharpen(m, -200);
m = Sharpen(m, -200);
m = Sharpen(m, -200);
m = Sharpen(m, -200);
m = Sharpen(m, -200);
w.DrawImage(0, 0, m);
}
};
GUI_APP_MAIN
{
MyApp().Run();
}
|
|
|
Goto Forum:
Current Time: Fri May 03 21:04:50 CEST 2024
Total time taken to generate the page: 0.01961 seconds
|