2 using System.Collections.Generic;
6 using System.Threading.Tasks;
8 using SharpDX.Direct2D1;
14 public class Image : Element
23 public Image( グラフィックデバイス gd, string imagePath )
25 this._画像 = new 描画可能画像( imagePath );
28 public Image( グラフィックデバイス gd, Size2F size )
30 this._画像 = new 描画可能画像( new Size2( (int) size.Width, (int) size.Height ) );
34 protected override void OnDispose()
36 this._画像?.非活性化する( null ); // このクラスは null でも OK
40 public void DrawToImage( グラフィックデバイス gd, Action<DeviceContext1> action )
42 this._画像.画像へ描画する( gd, action );
45 protected override void OnRender( グラフィックデバイス gd, PointF upperLeft )
47 upperLeft += new SizeF( this.Location );
48 this._画像.描画する( gd, upperLeft.X, upperLeft.Y );
52 protected 描画可能画像 _画像 = null;