hello,
i can't find any menber function of CDC or CClientDC which gives the size of the DC...
does this kind of function exist ?
thanks!
Printable View
hello,
i can't find any menber function of CDC or CClientDC which gives the size of the DC...
does this kind of function exist ?
thanks!
Don't you just need to use :
int size = sizeof(CDC) ; // get the size
Roger Allen
i don't want the size of the memory object but the drawable size of the DC !
thanks!
I think you have to get this information from the view you are drawing onto.
If you can get the DC of an object, you can call GetClientRect() or GetWindowRect() function on it to get the size of it.
Soz, for my earlier misunderstanding.
HTH
Roger Allen
Try GetDeviceCaps().
Regards,
Paul McKenzie
To the best of my knowledge, there is no such
thing as drawable size of CDC. However, it is
implicitly defined by the size of the bitmap
that is selected into CDC. Use the following
*untested* code to obtain it:
CSize szDrawSize(0,0);
CBitmap *pbmDraw = pDC->GetCurrentBitmap();
if (pbmDraw)
{
szDrawSize = pbmDraw->GetBitmapDimension();
}
// You have it in szDrawSize.cx and szDrawSize.cy