2008-09-01から1ヶ月間の記事一覧
プロジェクトファイルのあるディレクトリにimageフォルダがあり、そのフォルダ内にtest.jpgがあるとした場合 ①ソリューションエクスプローラにimageフォルダを作成し、追加、既存の項目よりtest.jpgを入れる ②test.jpgファイルのプロパティでビルドアクショ…
下記はListクラスのメンバForEachにおける使い方 void MyAction(int x) { Console.WriteLine(x); } int[] data = { 9, 2, 12, 17, 8, 1, 19 }; List list = new List(data); // 使い方その1 Action myActionDelegate = new Action(MyAction); list.ForEach(m…
Streamを使用するならResources.resxファイルに画像ファイルを埋め込んでおく必要性があまり感じない・・・。 これもゴチャゴチャしているので何とかなら無いものか System.Drawing.Bitmap gifBitmap = Properties.Resources.numericExpression01; // gif Me…
もっと簡単な方法があったのでメモ。 // Create source. BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.UriSource = new Uri("test.png", UriKind.Relative); bi.EndInit(); // Create the image element. Image simpleImage = new Image(); simp…
FileStreamを利用する。紛らわしいクラスが複数あるのでFileStreamのメンバを豪華にしてFileStreamだけにしたほうが良いのではないかと思ったりする StreamReader → テキストファイル向け。名前からしてテキストファイル向けかわからない! Stream → 抽象ク…