Posts

Pinta Effects for Your .NET Apps

Image
Pinta wouldn't exist today without the amazing code from the previously open source Paint.NET.  Now we've decided to pay it forward and make that same code available for other developers to easily use in their applications.

To accomplish this, we've extracted the code for all of Pinta's effects into a graphics toolkit agnostic library called Pinta.ImageManipulation and posted it up on NuGet for easy use.  This includes over 35 multi-threaded effects exposed as cancelable Tasks.

The core of Pinta.ImageManipulation is graphics toolkit agnostic and only works on arrays of BGRA bytes, but we've also included wrappers for System.Drawing (GDI+) and Cairo (GTK+).

Now that you've got all those great new holiday photos, let's see how to apply an effect to them in 5 lines of code.

Create a new project, bring up the NuGet dialog, and search for Pinta:


Select the Pinta.ImageManipulation.System.Drawing package and install it...


..which adds 2 new project references, the…

Mono for Android Portable Libraries in VS

Image
Thanks to Scott Hanselman's recent article on .NET's support for Portable Class Libraries (PCLs), there has been some renewed interested in using them for Mono for Android.

If you try to add a reference to a compiled PCL assembly, things should work, as VS simply checks that the version of mscorlib.dll referenced is the same as the MFA project (2.0.5).  However, if you try to add a reference to a PCL project, you get this nasty dialog box:



The bad news is we don't ship any tooling for supporting these out of the box yet.  The good news is it's trivial to do it yourself!

The portable libraries are installed in .NET's Reference Assemblies folder, which is here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0

If you explore around in that folder, you will see there are something called "Profiles" which specify the common assemblies for a given set of targets.

For example, "Profile2" targets .NET 4, Silverlight 4, an…

Playing With Roslyn

Image
As a tools guy, I've been fascinated with Roslyn ever since Microsoft previewed it. It looks like it provides lots of power for tools to consume. Now that the first CTP is out, I spent some time over the weekend playing with it.

The first thing it gives you access to is parsing source code, giving you an object model you can play with, and then letting you spit the modified source code back out. Reading source code in is easy:
var source_text = File.ReadAllText ("input.txt"); var tree = SyntaxTree.ParseCompilationUnit(source_text); var root = (CompilationUnitSyntax)tree.Root; Now we have an object model we can play with. We can search through the model for specific tokens and replace them with new ones, like this:
// Replace "Hello World!" with "Goodbye World!" var output = root.GetFirstToken (p => p.Kind == SyntaxKind.StringLiteralToken); var new_output = Syntax.StringLiteralToken ("\"Goodbye World!\"", "Goodbye World!…

Pinta 1.0 Released

Image
After roughly 16 months of development, Pinta is proud to join the ~1% of open source projects that make it to version 1.0!

I am extremely pleased of how Pinta has turned out, and extremely grateful for everyone who sent encouragement, bug reports, patches, and translations.



Some 1.0 Links:
- Release Notes
- Downloads
- Bug Tracker
- Feature Requests

In the next month or so I'll get up a roadmap of where future Pinta development will be going. Hint: Plugins.

Thanks again to everyone who helped make this happen, and here's hoping for another great 16 months of development!

Lesson of the Week

Apparently if you want third parties (Apple App Store, Google Marketplace, MS App Store) to distribute your software for you, you shouldn't choose a license that forces requirements on distributors.

MonoDroid Progress

Image
About 4 months ago, I worked on porting some of the Android SDK samples to run on MonoDroid. It was a soul-crushing failure. Every line of code I wrote exposed a new bug in MonoDroid which I had to wait until it got fixed to continue. Eventually I gave up on doing anything more than the absolutely trivial Hello World.

What a different story things are today!

I dusted off my unfinished Snake port, and it now works without modification.


Since I did it so long ago, there was no telling what magic I had in there to make it work on MonoDroid, so I ported another one from scratch. I grabbed the hardest sample I think they have: JetBoy. It's basically a fast-paced, Guitar Hero-esque game where you have to fire your laser to the music as each asteroid passes across the beat line.

After an afternoon of literal translation to C# (over 1k LOC), I fixed up the few Java porting issues like anonymous classes and nested classes accessing the parent class's private variables, and it *just wor…

Full of Hot Air

Image
Today there were several hot air balloons out when I came home.


One came closer and closer to my house.


And landed in the street in front of my house.


It was then deflated and sent on its way.


Shot from the inside.


Full Photo Set On Flickr