TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mayur Ghatkar
NA
113
8.7k
About Rotation image in any Angle
Jun 28 2017 7:16 AM
Hello,
I am dealing with images in my project. I am giving some angle and my Image should rotate in that angle. But It only rotate in multiples of 90 as I am using TransformedBitmap.
So please help me for rotating image in any angle and after rotation new image will be saved.
thanks in advanced.
Source code is:-
Image image = new Image();
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.BeginInit();
bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
bitmapImage.UriSource = new Uri(_DataSource.BackgroundImageFullPath);
bitmapImage.EndInit();
image.Source = bitmapImage;
BitmapSource img = (BitmapSource)(image.Source);
//rotate tif and save
CachedBitmap cache = new CachedBitmap(img, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
TransformedBitmap tb = new TransformedBitmap(cache, new RotateTransform(imgAngle));
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(tb));
using (FileStream file = File.OpenWrite(_DataSource.BackgroundImageFullPath))
{
encoder.Save(file);
}
Reply
Answers (
4
)
Autocomplete text box in the Datagrid in WPF how to do this
How to make String to bold