i want to get a image when user print from other applications.
then i hook some api.
first i hooked createdcw and in my hook funciton, i create a memory dc(by CreateCompatibleDC(NULL) ) and return. but the target application show a error.
then, i in my createdcw i create both printer dc(call real createdcw) and a memory dc, and save the memory dc in a map which the key is printer dc. i also create a hbitmap with the with and height same as printer dc(use GetDeviceCaps(hdcPrinter, HORZRES) and GetDeviceCaps(hdcPrinter, VERTRES) ). in my hooked ExtTextOutW(for test, the target application use this function when printing), i get the memory dc by printer dc from the map. and call the real ExtTextOutW to draw the text to memory dc and printer dc.
and at my hooked EndPage function, i save the memory dc to a .bmp file.
but the words in the .bmp file is too small and the character spacing is too large. i think maybe the problem is dpi, memory dc is 96 and the printer dc is 600.
How can i solve this problem?