Saving a memory DC to a file
-
When doing drawing first you do it to memory than BitBlt to the device -> device context can to you save the memory dc to a file ? thanks
Sure. See this sample: Capturing an Image - Win32 apps | Microsoft Docs[^]
Mircea
-
When doing drawing first you do it to memory than BitBlt to the device -> device context can to you save the memory dc to a file ? thanks
No, as shown in the documentation at GetDC function (winuser.h) - Win32 apps | Microsoft Docs[^]:
Quote:
The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI.
You need to save other information that you use to create the drawing.
-
Sure. See this sample: Capturing an Image - Win32 apps | Microsoft Docs[^]
Mircea
-
No, as shown in the documentation at GetDC function (winuser.h) - Win32 apps | Microsoft Docs[^]:
Quote:
The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI.
You need to save other information that you use to create the drawing.
-
I am writing a pie chart using pie and ellipse first doing CreateCompatableBitmap Selecting to mem dc but the example will work
Mircea provided an example that will work for me thanks
ForNow wrote:
Mircea provided an example that will work for me
Yes. However in this example the bitmap is saved into the file, and not the memory or some other DC (device context)!