Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Wed, 13 September 2017 18:35
Hello 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?

index.php?t=getfile&id=5398&private=0

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();
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [Closed] Get size and position of widget
Next Topic: Size of TopWindow is different then the size I set for it
Goto Forum:
  


Current Time: Fri May 03 21:04:50 CEST 2024

Total time taken to generate the page: 0.01961 seconds