|
-
May 16th, 1999, 01:15 AM
#1
Converting twip?
I know a twip is 1/20 of a point but what is a twip to a pixel? and a point
to a pixel conversion?
Thanks
-
May 16th, 1999, 05:37 AM
#2
Re: Converting twip?
Check out the Screen.TwipsPerPixelX Screen.TwipsPerPixelY.
-
May 19th, 1999, 07:47 PM
#3
Re: Converting twip?
Why not set the Scale property on your form to pixels instead of twips.
Gordito
-
March 30th, 2000, 06:45 PM
#4
Re: Converting twip?
For VC++ programmers, take a look at: http://support.microsoft.com/support.../Q196/8/33.ASP
Here are some snippets of code copied from above. You may also need to use MapDialogRect() or GetDialogBaseUnits().
int m_nLogX;
int m_nLogY;
// To convert grid rect from twips to DC units you need
// pixels per inch.
CDC* pDC = GetDC();
m_nLogX = pDC->GetDeviceCaps(LOGPIXELSX);
m_nLogY = pDC->GetDeviceCaps(LOGPIXELSY);
ReleaseDC(pDC);
// Create invisible edit control.
m_edit.Create(WS_CHILD|ES_MULTILINE|ES_WANTRETURN,
CRect(0,0,0,0), this, GetDlgCtrlID());
// Adjust for border height and convert from twips to screen
// units.
m_edit.MoveWindow(((GetCellLeft() - m_lBorderWidth) *
m_nLogX)/1440,
((GetCellTop() - m_lBorderHeight) * m_nLogY)/1440,
(GetCellWidth()* m_nLogX)/1440,
(GetCellHeight()* m_nLogY)/1440, FALSE);
m_edit.ShowWindow(SW_SHOW);
m_edit.SetFocus();
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
|