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++ TheIDE and Library: Releases and ChangeLogs » plugin/tif now supports SeekPage for multiimage tiffs
plugin/tif now supports SeekPage for multiimage tiffs [message #13920] Fri, 01 February 2008 21:15 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Example:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct App : TopWindow {
	FileIn      tiff;
	One<StreamRaster> raster;
	int         pageno;
	
	virtual bool Key(dword key, int) {
		if(key == K_PAGEUP && pageno > 0) {
			pageno--;
			Refresh();
		}
		if(key == K_PAGEDOWN && pageno < raster->GetPageCount() - 1) {
			pageno++;
			Refresh();
		}
		return true;
	}

	virtual void Paint(Draw& w) {
		ImageEncoder t;
		raster->SeekPage(pageno);
		Rescale(t, GetSize(), *raster, raster->GetSize());
		w.DrawImage(0, 0, t);
	}

	App() {
		Sizeable().Zoomable();
		tiff.Open("e:/fax.tif");
		raster = StreamRaster::OpenAny(tiff);
		pageno = 0;
	}
};


GUI_APP_MAIN
{
	App().Run();
}


Mirek
Re: plugin/tif now supports SeekPage for multiimage tiffs [message #13922 is a reply to message #13920] Fri, 01 February 2008 21:26 Go to previous message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Many thanx ! Smile

Max
Previous Topic: TIFF leak...
Next Topic: Improved Bar chameleon and BlueBar skin
Goto Forum:
  


Current Time: Fri Mar 29 09:26:44 CET 2024

Total time taken to generate the page: 0.01267 seconds