Friday, September 7, 2012

Silverlight WriteableBitmap not converting custom font correctly

Silverlight WriteableBitmap not converting custom font correctly

We use custom fonts to represent road signs and shapes that we plot on a graph.

Initially I plotted everything to a canvas, which worked fine, but was slow to scroll horizontally.

Then I fixed the scrolling issue by converting the canvas to a image using the WriteableBitmap, like this:

#if SILVERLIGHT     ImageSource ConvertCanvas(Canvas canvas) {          WriteableBitmap Source = new WriteableBitmap(canvas, /* transform = */ null);          Source.Invalidate();          return Source;     } 

No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog