Code: Select all
wxPdfDocument::Image ( const wxString & file,
double x,
double y,
double w = 0,
double h = 0,
How to convert millimeters to pixels?
Code: Select all
wxPdfDocument::Image ( const wxString & file,
double x,
double y,
double w = 0,
double h = 0,
No, that is simply not true. The position, height, and width of the image are given in user units, that is, the unit system selected on creating the wxPdfDocument class instance. The default unit system is millimeters, but centimeters, points or inches are also selectable.cutecode wrote:in functionx,y,w,h - are pixelsCode: Select all
wxPdfDocument::Image ( const wxString & file, double x, double y, double w = 0, double h = 0,
That is, you can specify the image dimensions (width and height) explicitly, or just width or height, or nothing (leaving it to wxPdfDocument to determine the image size).wxPdfDocument API wrote: The dimensions can be specified in different ways:
- explicit width and height (expressed in user unit)
- one explicit dimension, the other being calculated automatically in order to keep the original proportions
- no explicit dimension, in which case the image is put at 72 dpi
Usually there is no need to convert image dimensions. Just use the width or height of the image in millimeters you want in the resulting PDF document, and wxPdfDocument will scale it accordingly. However, this only works if you use millimeters as the wxPdfDocument unit system.cutecode wrote:but a I want to draw an image using millimeters.
How to convert millimeters to pixels?