ImageSource LoadImage(string filePath)
{
BitmapImage img = new BitmapImage();
try
{
img.BeginInit();
img.UriSource = new Uri(filePath, UriKind.RelativeOrAbsolute);
img.CacheOption = BitmapCacheOption.OnLoad;
//img.CreateOptions = BitmapCreateOptions.DelayCreation;
img.DecodePixelWidth = 50;
//img.DecodePixelHeight = 200;
img.EndInit();
}
catch
{
}
return img;
}
By the way, I have at last set up SyntaxHighlighter for my blog! this is sweet. Thanks to this post for the instructions.
No comments:
Post a Comment