怎么旋转后再绘画会变成什么都看不见的?
Image I=new Bitmap(100,100);
Graphics g=Graphics.FromImage(I);
g.FillRectangle(new System.Drawing.SolidBrush(Color.White),0,0,100,100);
g.RotateTransform(90);
g.DrawString("abc",new Font("",10,System.Drawing.FontStyle.Bold),new SolidBrush(Color.Black),0,0);
I.Save("i.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);

解决方案 »

  1.   

    g.RotateTransform(90);加个F试试
    g.RotateTransform(90F);
      

  2.   

    说的先旋转是指图像先旋转,使用Bitmap的成员RotateFlip方法,将图形翻转成你需要的角度,然后再使用g进行绘图,这样肯定没有问题的!
      

  3.   

    To:hychieftain加個f也不行啊
    Image I=new Bitmap(100,100);
    Graphics g=Graphics.FromImage(I);
    g.FillRectangle(new System.Drawing.SolidBrush(Color.White),0,0,100,100);
    g.DrawString("abc",new Font("",10,System.Drawing.FontStyle.Bold),new SolidBrush(Color.Black),0,0);
    g.RotateTransform(90f);
    I.Save("i.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
      

  4.   

    TO:haohaohaohao按照你这样也不行啊Image I=new Bitmap(100,100);
    I.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipX);
    Graphics g=Graphics.FromImage(I);
    g.FillRectangle(new System.Drawing.SolidBrush(Color.White),0,0,100,100);
    g.DrawString("abc",new Font("",10,System.Drawing.FontStyle.Bold),new SolidBrush(Color.Black),0,0);
    I.Save("i.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
      

  5.   

    原来要这样才行
    Image I=new Bitmap(100,100);
    Graphics g=Graphics.FromImage(I);
    g.FillRectangle(new System.Drawing.SolidBrush(Color.White),0,0,100,100);
    g.DrawString("abc",new Font("",10,System.Drawing.FontStyle.Bold),new SolidBrush(Color.Black),0,0);
    I.RotateFlip(System.Drawing.RotateFlipType.Rotate90FlipNone);
    I.Save("i.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);