seeCreating a Watered Photograph with GDI+ for .NET
http://www.codeproject.com/csharp/water.asp

解决方案 »

  1.   

    你先用bitmap對象把圖片打開.
    再用drawtext繪制文字
      

  2.   

    System.Drawing.Image image = System.Drawing.Image.FromFile( Server.MapPath( imgPhyName ) );
    System.Drawing.Image newImage = new Bitmap( image.Width, image.Height, PixelFormat.Format32bppRGB );
    Graphics graphics = Graphics.FromImage( newImage );
    graphics.DrawImage( image, 0, 0,image.Width, image.Height );
    Font font = new Font( FontType.SelectedItem.Text, Int32.Parse( FontSize.SelectedItem.Text ) );
    Brush brush = new SolidBrush( Color.Red );
    graphics.DrawString( "Hello,World!", font, brush, 10, 140 );
    graphics.Dispose();
    newImage.Save( Server.MapPath( newImgPhyName ), ImageFormat.JPEG );