Load a jpg file : JPG : Drawing 2D C# Examples


C# Examples » Drawing 2D » JPG »

 

Load a jpg file








    
using  System;
using  System.Drawing;
using  System.Drawing.Drawing2D;
using  System.Collections;
using  System.ComponentModel;
using  System.Windows.Forms;
using  System.Data;

public  class  BitmapLoading  :  System.Windows.Forms.Form
{
    public  BitmapLoading()
    {
        this.BackColor  =  System.Drawing.Color.White;
        this.ClientSize  =  new  System.Drawing.Size(400,  400);
        this.Paint  +=  new  System.Windows.Forms.PaintEventHandler(this.BitmapLoading_Paint);
    }

    static  void  Main()  
    {
        Application.Run(new  BitmapLoading());
    }

    private  void  BitmapLoading_Paint(object  sender,  System.Windows.Forms.PaintEventArgs  e)
    {
        Graphics  g  =  e.Graphics;
        Bitmap  b  =  new  Bitmap("YourFile.jpg");
        g.DrawImage(b,  10,  10,  350,  300);
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Drawing 2D
» JPG