No, it's not. You'll have to perform the conversion yourself. Here's how it's done when upgrading VB6 code to VB.NET:As you can see, it involves invoking the Windows API. As such, it's a bit of a pain but you can implement something similar yourself.Code:Private Shared Sub SetUpTwipsPerPixel(ByVal Optional Force As Boolean = False) If (Not Support.m_IsTwipsPerPixelSetUp OrElse Force) Then Support.m_TwipsPerPixelX = 0 Support.m_TwipsPerPixelY = 0 Try Dim dC As IntPtr = NativeMethods.GetDC(NativeMethods.NullIntPtr) If Not dC.Equals(NativeMethods.NullIntPtr) Then Support.m_TwipsPerPixelX = (1440 / CDbl(NativeMethods.GetDeviceCaps(dC, &H58))) Support.m_TwipsPerPixelY = (1440 / CDbl(NativeMethods.GetDeviceCaps(dC, 90))) NativeMethods.ReleaseDC(NativeMethods.NullIntPtr, dC) End If Catch exception1 As Exception ProjectData.SetProjectError(exception1) ProjectData.ClearProjectError End Try Support.m_IsTwipsPerPixelSetUp = True If ((Support.m_TwipsPerPixelX = 0) OrElse (Support.m_TwipsPerPixelY = 0)) Then Support.m_TwipsPerPixelX = 15 Support.m_TwipsPerPixelY = 15 VB6Errors.RaiseError(7, Resources.GetResourceString("Misc_SetUpTwipsPerPixel")) End If End If End Sub



LinkBack URL
About LinkBacks




Reply With Quote




Bookmarks