Jump to content

Document.Render obsolete

Recommended Posts

With previous versions of Paint.NET, when you wanted to create a FileType addon, the following code was valid:

protected override void OnSave(Document input, System.IO.Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback)
   using (RenderArgs ra = new RenderArgs(new Surface(input.Size)))

       var rawData = GetBitmapBytes(ra.Bitmap);
       output.Write(rawData, 0, rawData.Length);

Now the Document.Render() method is obsolete and there is a vague reference to PaintDotNet.Rendering.IRenderer<ColorBgra> Document.CreateRenderer() but not documentation on how to use it.

Anybody know how to make the code above work with the new method?

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.

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.

  • Create New...