-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brush painting from a image #35
base: master
Are you sure you want to change the base?
Conversation
-CORE -GDI (not tested) -WFP (not tested) Added test for XImageBrush
Should I update to the latest version or close it? |
The image looks good, but "WPF (not tested)" and "GDI (not tested)" in the changelog made me hesitate and I did not evaluate the PR yet. |
I compiled, but didn't test it as I don't know how to test it correctly. I haven't found any tests on WPF and GDI for PDFSharp, only for CORE. |
In most cases, the .cs files exist only in the Core folder, but are linked by the GDI and WPF projects. |
Thanks for the reply, I'll try to get it done this week |
…geBrush Conflicts: src/foundation/src/PDFsharp/src/PdfSharp/Drawing.Pdf/XGraphicsPdfRenderer.cs
-XImageBrush: -Added info header to file -XImage is always created -XGraphicsPdfRenderer: -Added XImageBrush implementation when saving to PDF for WPF (tested) and GDI (not tested because NRE in BeginContainer)
I fixed the WPF implementation and checked that it works when saving to a PDF file. With GDI, however, there are problems. In order to clip an area created by an image, I create a container (new XGraphicsContainer), make a SetClip on the passed object (XGraphicsPath), fill the area with images and close the container. In the GDI implementation I need GraphicsState to create a container, but as far as I understand, it may not exist. What should I do in this case (file XGraphicsPdfRenderer.cs)?
Another question, as far as I understand in the GDI implementation you can't do this?
Message: Stack Trace: |
Hello. I have not been able to solve the problem with creating XGraphicsContainer. Can you please tell me if there is any way to create XGraphicsContainer for GDI implementation?
Best Regards, |
About pull request
Added possibility to create a brush by image.
If a brush was created on the image, then:
1)The area is drawn by the image.
2)The area is clipped to the object
3)The object is drawn (if a pen has been set).
Example:
HelloImageWorld-B4FEA3FE6CD74639B3180A99F226EDD7_tempfile.pdf
Changelog
Added class XImageBrush.cs
For class XImageBrush are realized:
Added implementation for the XGraphicsPdfRenderer for:
Added a test for the implementation.