RotateTransform不起作用

RotateTransform不起作用

本文介绍了Graphics.RotateTransform不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



 位图img =(位图)Properties.Resources.myBitmap 。克隆(); 
图形g = Graphics.FromImage(img);
g.RotateTransform(45);
pictureBox1.Image = img;

显示图片,但不会旋转。



尝试使用 g.DrawImage(...) 来显示图片,而不是

I'm not sure why it's not working...

    Bitmap img = (Bitmap)Properties.Resources.myBitmap.Clone();
    Graphics g = Graphics.FromImage(img);
    g.RotateTransform(45);
    pictureBox1.Image = img;

The image is displayed, but it is not rotated.

解决方案

You are rotating the graphics interface, but not using it to draw the image. The picturebox control is quite simple, and may not be your friend here.

Try using g.DrawImage(...) see here to display the image instead

这篇关于Graphics.RotateTransform不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 03:30