我做一个N幅图片合并成一幅图片,用了一下方法:
Bitmap bm=new Bitmap(27,26);
Graphics g=Graphics.FromImage(bm);
image3=new Bitmap("C:\\Inetpub\\wwwroot\\DIY\\images\\human\\face\\1.gif");
image4=new Bitmap("C:\\Inetpub\\wwwroot\\DIY\\images\\human\\hair\\1.gif");
g.DrawImage(image3,0,0);   
g.DrawImage(image4,0,0);但是之后,我就不知道如何在我的页面上把我Graphics g给呈现出来啊!
我用了下面这个方法但是不行啊!也不知道用的对不对!
g.FillRectangle(new SolidBrush(Color.White), new Rectangle(0,0,30,30));各位大哥麻烦帮忙指教一下,如何把我们作好的图片呈现在页面上!感谢万分!感谢万分!

解决方案 »

  1.   

    g.DrawImage(image3,0,0,200,200);
    g.DrawImage(image4,50,50,100,100);
      

  2.   

    private void AutoSizeControl(Control control, int textPadding)
    {
       // Create a Graphics object for the Control.
       Graphics g = control.CreateGraphics();   // Get the Size needed to accommodate the formatted Text.
       Size preferredSize = g.MeasureString(
          control.Text, control.Font).ToSize();   // Pad the text and resize the control.
       control.ClientSize = new Size(
          preferredSize.Width + (textPadding * 2), 
          preferredSize.Height+(textPadding * 2) );   // Clean up the Graphics object.
       g.Dispose();
    }你要在某一个control上面画,必须在它的名字上创建一个对象,Yourcontrol.CreateGraphics();
    具体请看msdn  CreateGraphics 方法