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 » Developing U++ » U++ Developers corner » Optimizing DrawImage across platforms
Optimizing DrawImage across platforms [message #53611] Wed, 15 April 2020 09:52 Go to previous message
Tom1
Messages: 1277
Registered: March 2007
Senior Contributor
Hi,

There is an issue with ViewDraw when using the GTK3 backend on Linux. The following testcase works correctly on Windows (GUI) and Linux (GUI X11) but not on Linux (GUI) using GTK3. The cross should follow the cursor on the white background, but on GTK3 the entire window goes black and only the area updated with ViewDraw is valid afterwards.

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class Testcase5 : public TopWindow {
public:
	typedef Testcase5 CLASSNAME;
	
	Rect loc;
	
	Testcase5(){
		loc.SetNull();
	}

	void Paint(Draw &w){
		w.DrawRect(Rect(GetSize()),White());
		loc.SetNull();
	}
	
	void MouseMove(Point p, dword keyflags){
		ImageBuffer sb(32,32);
		BufferPainter sbp(sb);
		sbp.Clear(RGBAZero());
		sbp.Move(0,0).Line(31,31);
		sbp.Move(0,31).Line(31,0);
		sbp.Stroke(5,Gray());
		
		ViewDraw draw(this);
		if(!loc.IsNullInstance()) draw.DrawRect(loc,White());
		loc.Set(p.x-16,p.y-16,p.x+16,p.y+16);
		draw.DrawImage(loc.left,loc.top,Image(sb));
	}
};


GUI_APP_MAIN
{
	Testcase5().Run();
}


Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Rapsberry PI - cpu dilemma
Next Topic: U++ on Telegram
Goto Forum:
  


Current Time: Mon Dec 02 23:15:32 CET 2024

Total time taken to generate the page: 0.02477 seconds