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 set the dpi (dots per inch) of an image
Re: How to set the dpi (dots per inch) of an image [message #28035 is a reply to message #28024] Fri, 13 August 2010 13:46 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
luzr wrote on Fri, 13 August 2010 11:13

koldo wrote on Mon, 26 July 2010 03:50

Likewise, the same dpi detection would have to be added when reading a png file in bool PNGRaster::Init(), after png_read_info():

	png_read_info(data->png_ptr, data->info_ptr);
/// Begin
	png_uint_32 xres, yres;
	int unitType = PNG_RESOLUTION_METER;
	png_get_pHYs(data->png_ptr, data->info_ptr, &xres, &yres, &unitType);
	unsigned xdpi = unsigned(xres*0.0254);
	unsigned ydpi = unsigned(yres*0.0254);
/// End
	return true;


Here the question is where to put readed xdpy and ydpi in U++ code.


If you have this tested and working, please submit files as patch...

Mirek


Hello Mirek

Now xdpy and ydpi do not exist internally. It would be necessary to define how to get/set them, prior to adding the code.


Best regards
IƱaki
 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Icon at right side of the menuBar
Next Topic: GetExifThumbnail doc
Goto Forum:
  


Current Time: Tue Apr 23 12:57:11 CEST 2024

Total time taken to generate the page: 0.01092 seconds