Jump to content

Using dstArgs.Graphics and [SingleThreadedEffect]


Recommended Posts

Well of course you can look at BackgroundEffectRenderer.cs (BER) to see for yourself ... :)

BER always uses at least 2 threads: 1 is a dispatch thread, and the 2nd through N+1 threads are rendering threads. The rendering threads call your Render method, then raise an event to notify the main UI about the rendering progress (this is how we get the progress dialog). With the [sTE] attribute there is only ever 1 rendering thread, but it will still call your Render method many times to render the effect.

You must make sure to ONLY render within the rectangle that is provided to you in the Render method. If you are getting crashes then it is 99.9% likely that is a bug in your code and you should use the excellent debugging facilities in Visual Studio.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...