Rotate a BitmapImage

后端 未结 2 1042
南笙
南笙 2021-01-14 07:24

I want to rotate a bitmap image I wrote some code and it work

TransformedBitmap TempImage = new TransformedBitmap();

TempImage.BeginInit();
TempImage.Sourc         


        
2条回答
  •  無奈伤痛
    2021-01-14 07:53

    How about this?

    var transformBitmap = (TransformedBitmap)image1.Source;
    RotateTransform rotateTransform = (RotateTransform)(transformBitmap.Transform);
    rotateTransform.Angle += 90;
    image1.Source = transformBitmap.Clone();
    

提交回复
热议问题