Click here to Skip to main content
15,892,797 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCustom thumbnails? Pin
Romeozulu19-Mar-02 5:57
Romeozulu19-Mar-02 5:57 
AnswerRe: Custom thumbnails? Pin
Christian Graus19-Mar-02 10:26
protectorChristian Graus19-Mar-02 10:26 
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 
I use GDI+ Graphic::DrawImage to display and print a bitmap;
for display and print preview it works fine. But when printing, the bitmap is stretched or compressed on paper, depending of the printer resolution. To correct this problem, I applied a correcting factor :

long dpiPrinter = pDC->GetDeviceCaps(LOGPIXELSX);
long dpiScreen = 96; // returned by pDC->GetDeviceCaps(LOGPIXELSX)
// when displaying

double ratio = (double)dpiPrinter/dpiScreen;
destPoints[0].X /= ratio;
destPoints[0].Y /= ratio;
...

// destPoints[0...2] are the corners of the rectangle
// delimiting the zone on which the bitmap is to be printed

graphics.DrawImage(pData->pBitmap, destPoints, 3,
0, 0, bitmap.GetWidth(), bitmap.GetHeight(),
UnitPixel);

Bitmap size is now almost correct but still a bit too large.
And I don't see any reason why I have to modify the code for
printing : MFC show the correct image in print preview, so I
assumed I would get the same result on paper.

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 
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 

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.