Click to See Complete Forum and Search --> : Dim. of a DC
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!
Roger Allen
June 7th, 1999, 04:46 AM
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!
Roger Allen
June 7th, 1999, 05:54 AM
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
Paul McKenzie
June 7th, 1999, 03:55 PM
Try GetDeviceCaps().
Regards,
Paul McKenzie
Dan Ut
June 8th, 1999, 01:49 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.