大家是不是感觉太简单,其实这就是要动态生成一个个人桌面。因为要整齐,所以放到一个table里,用tablecell.controls.add(myimage).但再如何加text就不好办了

解决方案 »

  1.   

    参考在图上写字的代码: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 );