Hi all I have a simple problem in Drawing with GDI I made a button control and wote this code lines in its event handler
Graphics d = Form1.ActiveForm.CreateGraphics();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
try
{
d.DrawImage(Bitmap.FromFile(openFileDialog1.FileName), new Point(0, 0));
}
catch
{
MessageBox.Show("Sorry there is an error");
}
}
and the code worked but there is a simple problem in cases which the form have to be redrawn like when I minimize it so the image that I drew disappeared please I want to have a solution