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 force ImageView snippet to update in RT
how to force ImageView snippet to update in RT [message #9386] Thu, 03 May 2007 17:47 Go to previous message
ebojd is currently offline  ebojd
Messages: 225
Registered: January 2007
Location: USA
Experienced Member
I have some code that will eventually be a Real-Time graphics display. I am able to generate the proper images (via a libized version of Gnuplot)... I used a snippet of ImageView to load the image into a window:

void 
DCP::Load(const char *filename)
{
	img.SetImage(Null);
	FileIn in(filename);
	One<StreamRaster> r = StreamRaster::OpenAny(in);
	if(!r)
		return;
	Size rsz = img.GetSize();
	Size isz = r->GetSize();
	if(isz.cx >= rsz.cx || isz.cy >= rsz.cy) {
		if(isz.cx * rsz.cx < rsz.cy * isz.cy)
			rsz.cx = isz.cx * rsz.cy / isz.cy;
		else
			rsz.cy = isz.cy * rsz.cx / isz.cx;
		ImageEncoder m;
		Rescale(m, rsz, *r, isz);
		img.SetImage(m);
	}
	else
		img.SetImage(r->GetImage());
}


This works fine if I want to plot or display a single dataset, but my when my simulator loads up a dataset in a loop (which calls the processing routines and then loads the image):

void 
DCP::rt_sim()
{
	int i, ret;
	for(i=0;i<=320;i++)
	{
		char fname[256];
		
		sprintf (fname,"%s%02d.dat","./gauss_test",i%32);

		ret  = raw_range->read (fname, 0);
		ret |= raw_dat->read   (fname, 1);
		if (ret) {
        	PromptOK("[2R/ ERROR:]&parsing 2D input file in rt_sim");
        	return;
    	        }
    		
		raw_spectrum();
	}
}


nothing is displayed. I assume that the problem is that the load() method does not actually update the display and has to wait until control is given back to the main window.

My questions is: is there some trick to force an update the subwindow?

Thanks,

EBo --

[Updated on: Thu, 03 May 2007 18:09]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Private members in Switch used in Paint
Next Topic: CursorImage in RectTracker
Goto Forum:
  


Current Time: Fri Jun 06 22:23:03 CEST 2025

Total time taken to generate the page: 0.05155 seconds