Archive for the '.net' Category

01
Oct
09

measuring a string using .net


Here’s how you get the width and height of a string using the .NET framework ( the example is for IronPython, but you can easily adjust this for any CLI language ) :


size = System.Windows.Forms.TextRenderer.MeasureText("measure this",font)
print size.Width
print size.Height

note that font must be the font you’re using to draw the string.

18
Jul
09

my first boo code


I wrote a small utility to filter songs from a Winamp playlist. It was pretty fun to write. You can find the solution code here.

Here’s a screenshot :list_screen

I’ve commented the code if you want to read it.