I have created an Xaml "Image" object programatically from byte array & set its width, height, alignments. Setting width & height is important as I am fitting small image in bigger writableBitmap & aligning it in Center too.
- Image img = new Image();
- img.Height = x;
- img.Width = y;
- img.Source = inSource;
- img.HorizontalAlignment = HorizontalAlignment.Center;
In Phone 8.0, I did:
- RotateTransform transform = new RotateTransform();
- WritableBitmap bitmap = new WriteableBitmap(img, transform);// I want this step in UWP. How to do?
But, In UWP I am stuck as this writableBitmap constructor is not there where I can apply transformation on UI element like Image. I hope I am clear in my query. Please suggest me the way I can do this.
What I have tried: I have moved the WritableBitmap to bigger Writablebitmap aligning it to center(using Maths). Then using WriteBitmapEx, rotating the image to x angle (75, 45 etc.). But it is corrupting the image.
Any help will be appreciated.
Replies
Know the answer? Post it — somebody with the same question will find it here.