■■■

2016年4月3日日曜日

特定のコントロールを手動で描画する方法

特定のコントロールを手動で描画する方法
VB.NET
Dim canvas As New Bitmap(PictureBox1.Width, PictureBox1.Height)

Dim g As Graphics = Graphics.FromImage(canvas)
ControlPaint.DrawButton(g, 10, 10, 50, 20, ButtonState.Normal)
C#
Bitmap canvas = new Bitmap(PictureBox1.Width, PictureBox1.Height);
Graphics g = Graphics.FromImage(canvas);
ControlPaint.DrawButton(g, 10, 10, 50, 20, ButtonState.Normal);

■■■