| PDFsharp & MigraDoc Forum https://forum.pdfsharp.net/  | 
|
| Image subclassing problem https://forum.pdfsharp.net/viewtopic.php?f=2&t=2732  | 
	Page 1 of 1 | 
| Author: | freshlyshowered [ Mon Feb 10, 2014 7:11 am ] | 
| Post subject: | Image subclassing problem | 
Hello, in my application I have subclassed the MigraDoc Image class. If I add an instance of the class to a section everything works fine. However, if I add it to a paragraph, the image does not display. This can be seen using the following class Code: class ImageSub: Image{ public ImageSub(string path) : base(path) {} } The MDDDL files generated by using the above subclass and by using the Image class are identical, so this seems like a bug in the rendering code. Is there any way to work around this limitation? I am using the GDI+ version of MigraDoc.  | 
	|
| Author: | Thomas Hoevel [ Tue Feb 11, 2014 1:42 pm ] | 
| Post subject: | Re: Image subclassing problem | 
Hi! What's the purpose of your subclass? The MDDDL files are identical - so when the MDDDL is read, the normal Image class will be used and not your subclass.  | 
	|
| Author: | freshlyshowered [ Wed Feb 12, 2014 7:17 am ] | 
| Post subject: | Re: Image subclassing problem | 
I'm using a stack based approach to build PDFs from HTML, so I added interfaces and some helper methods to the subclasses to reduce the amount of type testing I have to do in my code. I did manage to work around this by using an extension method, but the behavior of not displaying the image only when it's inside a paragraph is still odd.  | 
	|
| Page 1 of 1 | All times are UTC | 
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/  | 
|