Replies: 2 comments 15 replies
-
Edit: the idea below won't work, see next comment.
Matrix3x2 transformMatrix = Matrix3x2.CreateRotation(...);
ImageBrush imageBrush = new ImageBrush(overlayImage);
destinationImage.Mutate(с => c.SetDrawingTransform(transformMatrix).FillRectangle(imageBrush, rectangle)); For more correct details, see this test: and the PR adding global transform for the transform API: |
Beta Was this translation helpful? Give feedback.
-
I'm trying to do something like this and I found another issue: it seems that ImageBrush don't care about alpha composition (Drawing 1.0.0-beta13) So, I'm trying to overlay one image over another image with a rotation, exactly the same issue described by @ggolda , but with the additional requirement that the source image has alpha transparency, I've tried these two approaches:
Furthermore, what I would need is to draw a region of the source image into the destination image, with a transform and blending composition. I believe this is a fairly common operation and I'm surprised I have to struggle so much every time I need to do something like this. I think an API such as this would be needed: public static IImageProcessingContext DrawImage(this IImageProcessingContext source, Image image, Rectangle imageRect, Matrix3x2 location, GraphicsOptions options); Also, it could be great if we could get a code snippet for an extension that does exactly that |
Beta Was this translation helpful? Give feedback.
-
How to draw an image atop of another one but with some rotation in degrees?
x.DrawImage()
call doesn't accept anything related to degrees or rotation matrices.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions