0

Hi,
The problem is that,
Am using a bitmap image and i want to click that image and place it to other location on the same form during run time, as well as use the drag and drop option, and also that image should be kept in buffer until i choose other image.
all this at run time using windows forms.
g.DrawImage(Image.FromFile("D:\\ccu\\symbols\\bitmap1.bmp"),20,145);
the above code is wat am using to call the image.
is ther any other way i can call it.

please help me out wit this.

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by serkan sendur
0

You can also store the image in memory:

public partial class frmFormPaint : Form
  {
    private Image img;

    public frmFormPaint()
    {
      InitializeComponent();
    }

    protected override void OnPaint(PaintEventArgs e)
    {
      base.OnPaint(e);
      if (img != null)
        e.Graphics.DrawImage(img, 20, 145);
    }

    private void button1_Click(object sender, EventArgs e)
    {
      img = Image.FromFile(@"C:\picture.bmp");
    }
  }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.