Image.FromFile : Image : Drawing 2D C# Examples


C# Examples » Drawing 2D » Image »

 

Image.FromFile









    
using  System;
using  System.Drawing;
using  System.Windows.Forms;
      
class  ImageFromFile:  Form
{
          public  static  void  Main()
          {
                    Application.Run(new  ImageFromFile());
          }
          public  ImageFromFile()
          {
                    Text  =  "Image  From  File";
                    ResizeRedraw  =  true;  
          }
          protected  override  void  OnPaint(PaintEventArgs  pea)
          {
                    DoPage(pea.Graphics,  ForeColor,ClientSize.Width,  ClientSize.Height);
          }          
          protected  void  DoPage(Graphics  grfx,  Color  clr,  int  cx,  int  cy)
          {
                    Image  image  =  Image.FromFile("Color.jpg");
      
                    grfx.DrawImage(image,  0,  0);
          }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Drawing 2D
» Image