Code: Select all
wxPdfDocument::Image ( const wxString & file,
double w = 0,
double h = 0,
x,y,w,h - are pixels
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.
Following a quote from the wxPdfDocument API documentation of the Image
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
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).
cutecode wrote:but a I want to draw an image using millimeters.
How to convert millimeters to pixels?
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.