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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Batch processing images using U++ (new Image code)
Batch processing images using U++ (new Image code) [message #2750] Mon, 24 April 2006 12:00
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, before I delete that code, I recently had a problem (while working on some www page): a couple of .bmp images had to be normalized to single size, horizontally center bottom aligned and added 2 pixels border and saved as 4 bpp PNG. Sure, one could use photoshop and do it image by image (and frankly perhaps there are some sofisticated tools that can do this), but one can also use U++:

	FindFile ff("e:\\h\\*.bmp");
	while(ff) {
		Image m = StreamRaster::LoadFileAny(AppendFileName("e:\\h", ff.GetName()));
		ImageDraw iw(64, 64);
		iw.DrawRect(0, 0, 64, 64, Color(255, 218, 91));
		DrawFatFrame(iw, 0, 0, 64, 64, Black, 2);
		iw.DrawImage((64 - m.GetWidth()) / 2, 62 - m.GetHeight(), m);
		PNGEncoder png(4);
		png.SaveFile(AppendFileName("d:\\images", ForceExt(ff.GetName(), ".png")), iw);
		ff.Next();
	}
Previous Topic: ForlanoVega ArrayCtrl console app...
Next Topic: Using value from EditInt
Goto Forum:
  


Current Time: Thu Mar 28 10:13:25 CET 2024

Total time taken to generate the page: 0.01040 seconds