C# note

Measure String Size In Pixels (C#)

Graphics.MeasureString Method:
Graphics graphics = this.CreateGraphics();
SizeF textSize = graphics.MeasureString("How long am I?", this.Font);

TextRenderer::MeasureText Method:
Size textSize = TextRenderer.MeasureText("How long am I?", font);

原文: Measure String Size In Pixels (C#)



Converting integer to hex string (C#)

int a = 123;
a.ToString("X8"); for 8 hex characters


原本: Converting integer to hex string

留言

這個網誌中的熱門文章

逃得了一時 逃不了一世

Google Hangouts

我老闆是真男人!