|
-
June 7th, 1999, 04:43 AM
#1
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!
-
June 7th, 1999, 04:46 AM
#2
Re: Dim. of a DC
Don't you just need to use :
int size = sizeof(CDC) ; // get the size
Roger Allen
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
-
June 7th, 1999, 05:29 AM
#3
Re: Dim. of a DC
i don't want the size of the memory object but the drawable size of the DC !
thanks!
-
June 7th, 1999, 05:54 AM
#4
Re: Dim. of a DC
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
Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
Please remember to rate useful answers. It lets us know when a question has been answered.
-
June 7th, 1999, 03:55 PM
#5
Re: Dim. of a DC
Try GetDeviceCaps().
Regards,
Paul McKenzie
-
June 8th, 1999, 01:49 AM
#6
Re: Dim. of a DC
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|