midora Posted December 18, 2012 Posted December 18, 2012 So I'm talking about effects which do not change the destination surface (like Printer+). Do they intercept the render function to show their dialog (because I can see the progress bar once while the dialog opens). Or is there an other way to integrate them as effect. What would be the parent of a dialog? Some example code would be fine. In the moment I would add to the Render function. - copy of source to dest surface (necessary?) - calling of the tools functionality (open dialog, ...) - calling of SignalCancelRequest() (this function looks like it could cancel the rendering) The reason is to implement a printing functionality which respects DPI settings of the image. Quote
Rick Brewster Posted December 18, 2012 Posted December 18, 2012 In your config dialog, set the DialogResult to Cancel before closing. Printer+ just "pretends" that it was cancelled, so no rendering happens. This is exactly the same as what happens if you press Cancel on a regular effect. The reason is to implement a printing functionality which respects DPI settings of the image. I'm pretty sure that won't be possible because the DPI information isn't available from the layer. Effects only get 1 layer's bitmap, not the actual layer and certainly not access to the whole image ("Document"). Also, here's a tip: if you find yourself asking "how is X implemented", just boot up your copy of Reflector (or ILSpy or whatever) and look at the disassembly Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html
midora Posted December 18, 2012 Author Posted December 18, 2012 I'm pretty sure that won't be possible because the DPI information isn't available from the layer. Effects only get 1 layer's bitmap, not the actual layer and certainly not access to the whole image ("Document"). I know this and I guess I already asked once to provide the DPI information and unit in the environment. Because of this issue 'Paper Models' plugin allows you to set 'unit and dpi' in the config dialog (and there is a hint in the property description entry telling you to set the value of the image). Not so nice for the user but I know you would not be happy if a plugin would use the dirty way to access the document values ;-) In general I'm a little bit tired to use reassembly tools to get informations. This is not the kind of documentation I like to use. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.