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 » Community » Newbie corner » How to lighten the process when draw a large amount image?
How to lighten the process when draw a large amount image? [message #47485] Sat, 21 January 2017 15:53
kurete is currently offline  kurete
Messages: 17
Registered: March 2016
Location: Japan
Promising Member

I make Tile Map Editor used Ultimate++ like RPG Maker.

However, this process is very sluggish.

What should I do?

Sample Code


#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class TileMapTest : public TopWindow {
public:
	typedef TileMapTest CLASSNAME;
	TileMapTest()
	{
		this->SetRect(0,0,640,480);
	}
	void Paint(Draw& w)
	{
		int a=w.GetPaintRect().GetWidth();
		for(int z=0;z<5;z++)
		{
			for(int i=0;i<120;i++)
			{
			  for(int m=0;m<120;m++)
			  {
			    if(static_cast<int>(100*Randomf())%2==0)
			    {
			      w.DrawImage(i*16,m*16,16,16,CtrlImg::File());
			    }
			  }
			}
	     }
	}
	void LeftDown(Point p,dword keyflags)
	{
		Refresh();
	}
};

GUI_APP_MAIN
{
	TileMapTest().Run();
}


Previous Topic: Does Ultimate++ have a function about jlayeredpane of swing of java ?
Next Topic: [SOLVED] Logging and LOG_APPEND
Goto Forum:
  


Current Time: Fri Mar 29 00:19:37 CET 2024

Total time taken to generate the page: 0.01425 seconds