print to image

02-03-2005, 03:35 AM

i have done some code that draws graphics to the printer using GDI. I want to let the users 'print' to a image, so that they can save a high resolution picture on their computer. The function that does the actual printing takes a dc, width, length and dpi. I would like to send it a dc that can be used for saving to bmp, this is not possible with the printers hdc. How do I accomplish that?

02-04-2005, 02:48 AM
sorry to bother you gurus with my questions :) I now use a picturebox that I draw to instead of the printer, and this works fine for small pictures. Now I want to create some high-resolution pictures but I get the well known error message about 'cant create autoredraw picturebox'. I should create a memory DC instead and then save it to file, but how do I do that without a picturebox (savepicture that is, I know how to create memDc) ?

02-04-2005, 07:06 AM
i'm back! i found some sample code at msdn. very easy to find on google when I searched for dibsections instead of device contexts :) If you ever need to save a high-res image and can not use a picturebox and savepicture, this is the way to do it:

i saved a 19200 x 15360 24bits picture in less than 2 seconds on my amd 2.0Ghz, the result file was > 100Mb but there were no problems at all

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum