{\r
this.sz画像サイズ = new Size( bitmap.Width, bitmap.Height );\r
this.szテクスチャサイズ = this.t指定されたサイズを超えない最適なテクスチャサイズを返す( device, this.sz画像サイズ );\r
- \r
+ this.rc全画像 = new Rectangle( 0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height );\r
+\r
using( var stream = new MemoryStream() )\r
{\r
bitmap.Save( stream, ImageFormat.Bmp );\r
{\r
this.sz画像サイズ = new Size( n幅, n高さ );\r
this.szテクスチャサイズ = this.t指定されたサイズを超えない最適なテクスチャサイズを返す( device, this.sz画像サイズ );\r
- \r
+ this.rc全画像 = new Rectangle( 0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height );\r
+ \r
using ( var bitmap = new Bitmap( 1, 1 ) )\r
{\r
using ( var graphics = Graphics.FromImage( bitmap ) )\r
\r
this.sz画像サイズ = new Size( information.Width, information.Height );\r
this.szテクスチャサイズ = this.t指定されたサイズを超えない最適なテクスチャサイズを返す( device, this.sz画像サイズ );\r
+ this.rc全画像 = new Rectangle( 0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height );\r
#if TEST_Direct3D9Ex\r
pool = poolvar;\r
#endif\r
/// <param name="y">描画位置(テクスチャの左上位置の Y 座標[dot])。</param>\r
public void t2D描画( Device device, int x, int y )\r
{\r
- this.t2D描画( device, x, y, new Rectangle( 0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height ) );\r
+ this.t2D描画( device, x, y, 1f, this.rc全画像 );\r
}\r
public void t2D描画( Device device, int x, int y, Rectangle rc画像内の描画領域 )\r
{\r
float f右U値 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float f上V値 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float f下V値 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int color = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ this.color4.Alpha = ( (float) this._透明度 ) / 255f;\r
+ int color = this.color4.ToArgb();\r
\r
if( this.cvTransformedColoredVertexies == null )\r
this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[ 4 ];\r
float f右U値 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float f上V値 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float f下V値 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int color = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ this.color4.Alpha = ( (float) this._透明度 ) / 255f;\r
+ int color = this.color4.ToArgb();\r
\r
if( this.cvPositionColoredVertexies == null )\r
this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[ 4 ];\r
/// </summary>\r
public void t3D描画( Device device, Matrix mat )\r
{\r
- this.t3D描画( device, mat, new Rectangle( 0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height ) );\r
+ this.t3D描画( device, mat, this.rc全画像 );\r
}\r
public void t3D描画( Device device, Matrix mat, Rectangle rc画像内の描画領域 )\r
{\r
float f右U値 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float f上V値 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float f下V値 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int color = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ this.color4.Alpha = ( (float) this._透明度 ) / 255f;\r
+ int color = this.color4.ToArgb();\r
\r
if( this.cvPositionColoredVertexies == null )\r
this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[ 4 ];\r
\r
return szサイズ;\r
}\r
+\r
+ \r
+ // 2012.3.21 さらなる new の省略作戦\r
+\r
+ private Rectangle rc全画像; // テクスチャ作ったらあとは不変\r
+ private Color4 color4 = new Color4( 1f, 1f, 1f, 1f ); // アルファ以外は不変\r
//-----------------\r
#endregion\r
}\r