Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
#wp7dev_jp
ローカルのファイルを読み込んで、加工して Imageコントロールに表示する。加工しなくてもいいけどね。もっと簡単な方法もあると思うけど。読み込む時間を加味したのがこのソース。なので、ImageOpened ハンドラを使っています。
//画像更新
private void updatedesign()
{
Uri uri = new Uri(@"Images/localimage.png", UriKind.Relative);
BitmapImage bi = new BitmapImage();
bi.CreateOptions = BitmapCreateOptions.None;
bi.ImageOpened += bi_ImageOpened;
bi.UriSource = uri;
}
void bi_ImageOpened(object sender, RoutedEventArgs e)
{
BitmapImage bi = sender as BitmapImage;
WriteableBitmap wb = new WriteableBitmap(bi);
//wbで画像処理
image.Source = wb;
}
Live Writer のこのInsert Codeプラグインはいいなぁ。