문제

I have following J# code

bigFont = new Font("Arial", bigFontSize, FontSize.PIXELS);

How I can convert above line to c# FontSize.PIXELS equivalent.

Thanks

도움이 되었습니까?

해결책

try

Font bigFont = new Font("Arial", bigFontSize, GraphicsUnit.Pixel);

see MSDN for further details.

다른 팁

You can use the GraphicsUnit.Pixel on the contstructor:

Font f = new Font("Arial", 25, GraphicsUnit.Pixel);
this.Font = f;

It looks like you're using this constructor for the Font, taking a font-family, an emSize, and a graphics unit.

In that case, you want a GraphicsUnit enumeration.

And it looks like the specific equivalent you want is System.Drawing.GraphicsUnit.Pixel.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top