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 » Draw, Display, Images, Bitmaps, Icons » How to efficiently update a large Image?
Re: How to efficiently update a large Image? [message #22911 is a reply to message #22899] Fri, 28 August 2009 00:24 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14257
Registered: November 2005
Ultimate Member
Tom1 wrote on Wed, 26 August 2009 01:57

Hi Mirek,

Sorry for the delay in my response -- been out of the office for a while.

Anyway, thanks for adding this functionality. In my application it really gives me far more that 2.5x speed boost.

Unfortunately, there is still some problem with X11. Generally, the new SetSurface works OK with partial updates and offsets, but when dragging another window over a window with image contents updated with SetSurface, the view gets severely scrambled.



I am sorry, but I have trouble reproducing the problem.

My current testcase:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyApp : TopWindow {
	RGBA pixels[65536];

	virtual void Paint(Draw& w) {
		Rect r = w.GetPaintRect();
		w.DrawRect(r, LtGray());
		Point p = r.TopLeft();
		if(p.x < 256 && p.y < 256)
			SetSurface(w, r, pixels, Size(256, 256), p);
	}

	MyApp() {
		RGBA *t = pixels;
		for(int x = 0; x < 256; x++)
			for(int y = 0; y < 256; y++) {
				int d = (x - 128) * (x - 128) + (y - 128) * (y - 128);
				RGBA c = Black();
				if(d > 120 * 120)
					c = White();
				if(d < 120 * 120)
					c.r = 255 - min(255 * d / (120 * 120), 255);
				*t++ = c;
			}
	}
};

GUI_APP_MAIN
{
	MyApp().Run();
}


Could you create some testcase that shows the problem?

Mirek


virtual void Paint(Draw &draw){
  // The image to draw is in ImageBuffer ib;
  Rect paintrect=draw.GetPaintRect();
  SetSurface(draw,paintrect,ib,ib.GetSize(),Point(paintrect.left,paintrect.top));
}


With GDI it's working correctly.

// Tom
[/quote]
 
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: Color menu choice
Next Topic: Support for 2bpp tiff images
Goto Forum:
  


Current Time: Tue May 13 08:11:47 CEST 2025

Total time taken to generate the page: 0.03155 seconds