right, I have a visual C# app in VS2003 and am trying to load and display and image on my form. I have the following code - there are no errors, however neither does anything appear. (image exists in that directory, yes - I've had to insert the "\\" cause otherwise it would complain about the unrecognized character scape sequence thingy)

private void Form1_Load(object sender, EventArgs e)
        {
            InitializeComponent();
            Bitmap objBitmap = new Bitmap("D:\\ImageRecognition\\image.jpg");
            Graphics g = Graphics.FromHwnd(Handle);
            g.DrawImage(objBitmap, 0, 0);

        }

please help!

>however neither does anything appear.

Place your code inside the Paint event handler of a form.

private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Bitmap bmp = new Bitmap(@"c:\folder\file1.gif");
            Graphics g = Graphics.FromHwnd(this.Handle);
            g.DrawImage(bmp, 10, 10);
        }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.