Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted (edited)

Hey! Is there a way to cancel the OnSave method so it doesn't write a null file?

 

Or is there any other way to do this

 

 

Dim SD As New SaveDialog
SD.ShowDialog
If SD.DialogResult = Ok Then
LOG("Save the image")
Else
LOG("Cancelled but writes null file")
LOG("Any way to stop that?")
End if

 

Before OnSave?

 

Here is my save dialog btw

nedKMq7.png

Edited by aaro4130
Posted

Why are you creating your own Save dialog?

 

This is completely outside the bounds of what's supported/allowed, and you won't be able to publish your plugin here on the forum.

 

The correct way to do this is to use the mechanism that's already provided for doing a Save Configuration UI. You should NOT be showing UI during OnSave, that's just completely backwards.

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

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

forumSig_bmwE60.jpg

Posted (edited)

Could you give me a hand on using the built in UI? I had no clue this type was not allowed. Is there any tutorial around?

Edited by aaro4130
Posted

Yeah there's nooooooo need to build your own dialog.

 

Either override the virtual method "CreateSaveConfigWidget()", or derive from PropertyBasedFileType. The latter, which uses something called IndirectUI, is much easier way to create UI for this type of stuff.

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

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

forumSig_bmwE60.jpg

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.

×
×
  • Create New...