public bool GetDPtoLP(GDIContext hDC)
{
if (!GDI32.GetWorldTransform(hDC, out fMatrix))
return false;
POINT origin = new POINT();
GDI32.GetWindowOrgEx(hDC, out origin);
Translate(-(float)origin.X, -(float)origin.Y);
SIZE sizew = new SIZE();
SIZE sizev = new SIZE();
GDI32.GetWindowExtEx(hDC, out sizew);
GDI32.GetViewportExtEx(hDC, out sizev);
Scale((float)sizew.Width / sizev.Height, (float)sizew.Height / sizev.Height);
GDI32.GetViewportOrgEx(hDC, out origin);
Translate((float)origin.X, (float)origin.Y);
return true;
}