890916 - resizing a memory dc
-
hi i need to create a memory dc with a specified dimensions. one way is to select a created or loaded bitmap in it which has the desired dimensions. is there any way else? thx
-
hi i need to create a memory dc with a specified dimensions. one way is to select a created or loaded bitmap in it which has the desired dimensions. is there any way else? thx
The HDC is just a drawing interface to 'something'. The DC itself does not have a size. It is usually backed by a window, a printer, or a bitmap. You always have to retrieve the size of the underlying object that backs the DC. This can be the client are of the window, the whole window, the size of the paper in your printer, the size of the bitmap or whatever. If your memory DC is backed by a bitmap, then you are right, you have to select another bitmap to the DC to change the size.
-
The HDC is just a drawing interface to 'something'. The DC itself does not have a size. It is usually backed by a window, a printer, or a bitmap. You always have to retrieve the size of the underlying object that backs the DC. This can be the client are of the window, the whole window, the size of the paper in your printer, the size of the bitmap or whatever. If your memory DC is backed by a bitmap, then you are right, you have to select another bitmap to the DC to change the size.
thank u :) i did this and the problem was resolved:
Ct2View::d\_tmpDC.CreateCompatibleDC(&dc); bitmap.DeleteObject(); bitmap.CreateCompatibleBitmap(&dc, Ct2View::d\_itemSize.cx, Ct2View::d\_itemSize.cy); Ct2View::d\_tmpDC.SelectObject(&bitmap);