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 » Screen coordinates to Printer coordinates Conversion?
Re: Screen coordinates to Printer coordinates Conversion? [message #14967 is a reply to message #14911] Sun, 23 March 2008 08:50 Go to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
This is not a trivial issue Smile

First of all, to print it, you perhaps want to know its physical dimensions. If it is loaded from the file, in Raster::Info there is a "dots" member that should be set to exactly this.

Now the next problem is rescaling. Oviously, rescaling the full page results in very big Image. To solve this, you need to get a step deeper and do the rescale by parts ("bands").

The simplest way how to do that is to use:

void DrawRasterData(Draw& w, int x, int y, int cx, int cy, const String& data);


Simply put the image file (.png, .jpg ... anything you have plugin in project) into "data" member and it will do the rest. It will even "RLE compress" the result (will detect uniform color areas and replace sending raster pixels with DrawRect).

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: How to hide a TopSeparatorFrame
Next Topic: TheIDE bug in layout designer?
Goto Forum:
  


Current Time: Sat Jul 19 12:09:01 CEST 2025

Total time taken to generate the page: 0.03313 seconds