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
Printable View
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
Check out the Screen.TwipsPerPixelX Screen.TwipsPerPixelY.
Why not set the Scale property on your form to pixels instead of twips.
Gordito
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();