Srinivas Allamkam


Hi all,

Could any one please tell what is the equivanet function of the TwipsToPixelsY, TwipsToPixelsX functions in VB.NET. These are supported by vb6 namespace if we use in .NET but i should not use VB6 in my project So please guide me what are the equivalents to these functions

Regards,




Re: TwipsToPixelsY, TwipsToPixelsX equivalent in VB.NET

JohnWein


They are VB6 functions. Why not use VB6 namespace

Anyway:

Code Block

Public Class Form1

Dim G As Graphics = Me.CreateGraphics

Dim TwipsToPixelsX As Integer = CInt(1440 / G.DpiX)

Dim TwipsToPixelsY As Integer = CInt(1440 / G.DpiY)

End Class

The math should probably be done in a function and the graphics disposed, but this form doesn't seem to cause any problems.