Click here to Skip to main content
15,915,864 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Custom thumbnails? Pin
Romeozulu19-Mar-02 11:07
Romeozulu19-Mar-02 11:07 
GeneralLoad & Display Image file types Using DirectDraw Pin
Dang Xuan Ky19-Mar-02 5:35
Dang Xuan Ky19-Mar-02 5:35 
GeneralRe: Load & Display Image file types Using DirectDraw Pin
Christian Graus19-Mar-02 10:26
protectorChristian Graus19-Mar-02 10:26 
GeneralNew Year in Iran ! Pin
Hadi Rezaee19-Mar-02 5:35
Hadi Rezaee19-Mar-02 5:35 
QuestionDrag & Drop like IE Favourites? Pin
Obliterator19-Mar-02 5:20
Obliterator19-Mar-02 5:20 
Generalprinting bitmap : size of the bitmap depends of printer resolution Pin
19-Mar-02 5:03
suss19-Mar-02 5:03 
GeneralRe: printing bitmap : size of the bitmap depends of printer resolution Pin
Christian Graus19-Mar-02 10:29
protectorChristian Graus19-Mar-02 10:29 
GeneralRe: printing bitmap : size of the bitmap depends of printer resolution Pin
27-Mar-02 0:24
suss27-Mar-02 0:24 
After many trials it works, and here are my conclusions, or rather my observations, because I don't have a clear understanding of what's happening.

I use the MM_LOMETRIC mapmode : logical units are 0.1 mm. The coordinates of the rectangle on which the bitmap is to be drawed are initially exprimed in these logical units. When I discovered that the size and position of the bitmap on paper were depending of the resolution of the printer, I thought of applying a correcting factor :

factor = dpiPrinter/dpiScreen
X1 /= factor
...

I get these dpi with pDC->GetDeviceCaps(LOGPIXELSX); for the printer it can be
75 ... 1200 dpi, and for screen it is 96.

On paper there was still a error of about 4 %; for example when I printed a bitmap whose
width was expected to be 50 mm, I got 48 mm on paper.
I have tested many hypotheses, including playing with Graphics.SetPageUnit(), Graphics.SetPageScale(), ... And finally an intuition, nothing rational but after all I was ready for black magic : an error of 4 %, OK let's say my dpiScreen is 100 and not 96... size and position are now perfect, for any printer resolution.

I assume that the LOMETRIC mapmode is in cause; as the logical units are not pixels, the screen resolution returned by GetDeviceCaps() is not relevant anymore; but then how do work the factor dpiPrinter/100 ? I have not tested yet with another mapmode, for example HIMETRIC (.01 mm). I guess (?) that my 100 would have to be replaced by 1000.

I can survive without understand that, but if someone has explanation...
General2 port nic com test Pin
gus19-Mar-02 4:59
gus19-Mar-02 4:59 
GeneralRe: 2 port nic com test Pin
Bill Wilson19-Mar-02 14:22
Bill Wilson19-Mar-02 14:22 
GeneralRe: 2 port nic com test Pin
gus20-Mar-02 5:12
gus20-Mar-02 5:12 
GeneralRe: 2 port nic com test Pin
Bill Wilson20-Mar-02 6:32
Bill Wilson20-Mar-02 6:32 
GeneralRe: 2 port nic com test Pin
gus20-Mar-02 6:38
gus20-Mar-02 6:38 
GeneralOpening files Pin
19-Mar-02 5:01
suss19-Mar-02 5:01 
GeneralRe: Opening files Pin
Tomasz Sowinski19-Mar-02 5:09
Tomasz Sowinski19-Mar-02 5:09 
GeneralI need help! Pin
hph19-Mar-02 4:55
hph19-Mar-02 4:55 
GeneralTooltips and disabled controls Pin
Dorset_Pete19-Mar-02 4:27
Dorset_Pete19-Mar-02 4:27 
GeneralRe: Tooltips and disabled controls Pin
Tomasz Sowinski19-Mar-02 4:40
Tomasz Sowinski19-Mar-02 4:40 
GeneralRe: Tooltips and disabled controls Pin
Dorset_Pete19-Mar-02 22:25
Dorset_Pete19-Mar-02 22:25 
GeneralRebuild All Blues Pin
Monty219-Mar-02 4:13
Monty219-Mar-02 4:13 
GeneralRe: Rebuild All Blues Pin
19-Mar-02 4:17
suss19-Mar-02 4:17 
GeneralRe: Rebuild All Blues Pin
Tomasz Sowinski19-Mar-02 4:26
Tomasz Sowinski19-Mar-02 4:26 
GeneralCrystal reports Control Pin
Monty219-Mar-02 4:11
Monty219-Mar-02 4:11 
GeneralRe: Crystal reports Control Pin
Bill Wilson19-Mar-02 14:24
Bill Wilson19-Mar-02 14:24 
GeneralRe: Crystal reports Control Pin
Monty220-Mar-02 2:06
Monty220-Mar-02 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.