DPI Problem While Opening And Saving Bitmap
Posted on 2000-04-20
I am working in platformsdk using win32 api's. I have opened an already existing bitmap and displayed it, using the functions. Through this application you can also create a bitmap and can save it to the hard disk.
and then selecting the bitmap in hdcbitmap using SelectObject and displayed it using StretchBlt.
While printing bitmap I think I will use PrinterDC instead of display device context DC in each of the above function.
The problem is the bitmap which is 300 dpi normally, comes to 72 dpi in my application when I opened it or when I save a bitmap made through my application, the reason may be because monitor dpi is 72 and I have used CreateCompatibleDC function with the display device everywhere except while printing. Now I want when I open or save Bitmap in the application using the above functions it should come in 300 dpi only as this is original and then it can be displayed or printed, for this what I have to do.
I suppose instead of CreateCompatibleDC(displaydevice) I have to use CreateCompatibeDC(printerdevice). Is it so.
Also if I will open bitmap like this can it be displayed on the screen apart from going to the printer as this is necessary.
If I am wrong in what I think then what is the solution for my problem.