Sign in to follow this  
Followers 0
captainruss

Newbie Question Re: Plugins

8 posts in this topic

I have used Paint.NET extensively in  making instrument graphics for flight simulators. I am brand new to the forum though.  

 

I need to place objects by coordinates in the Lua code I write to create these instruments.  I need the left. top. width. height valuse to include in functions.  Now I copy these values when a rect is selected with the selection tool.  

 

The are at the bottom of the window where it says   "selection Top Left:  <left>  <top>  and Bounding rectangle size; <width> X <height>

 

Ironically the text says Top Left but the values are reversed but are exactly  in the order I need, (see attached pic)

 

I end up writing these values in a piece of paper and later typing then into my scripts.

 

 

WOULD IT BE POSSIBLE... either via Plug-In that might already exist, a feature I don't know about, or with the addition of a feature

 

TO  have some button or contextual menu to copy these four coordinates , comma delimited, into the clipboard.

 

I right click and select a rect area and a contextual menu pops up with "copy coords".

 

Selecting would copy the  string " left , top, width, height "  (without the quotes of course) into the clipboard so I could paste them.

 

 

Anyone know if this exists, is possible, or how to get such a feature added to paint,NET?  ANyone want to write such a simple plugin if that is possible?

 

Any help greatly appreciated.

 

ps. see our work at  www.siminnovations.com

0

Share this post


Link to post
Share on other sites

Not possible by plugins; they can only do effects, adjustments, and filetypes. Not context menus.

EDIT: By not possible, I meant the context menus. Good on you, toe, for jumping in so fast!

0

Share this post


Link to post
Share on other sites

Ask and Ye shall receive.... in minutes.   Awesome...Thanks.  I will share with the rest of our instrument builder community.

 

I like this forum!

 

 

Here's a plugin.

 

Effects -> Tools -> Copy Selection Coords

 

attachicon.gifCopySelectionCoords.zip

0

Share this post


Link to post
Share on other sites

Here's the source code ...

I'm not sure it is a good idea to have an empty Render function. You should probably be writing to the DST surface for every pixel. Something like this:

void Render(Surface dst, Surface src, Rectangle rect)
{
    // Call the copy function
    dst.CopySurface(src,rect.Location,rect);
}
0

Share this post


Link to post
Share on other sites

I'm not sure it is a good idea to have an empty Render function. You should probably be writing to the DST surface for every pixel...

Oh, you're probably right. I've heard that mentioned many times here on the forum.

I'd be interested the technical reason for this. What sort of issues could arise from not writing to any of the pixels? Rick seems to have made it somewhat idiot proof, as the original canvas is preserved even though the dst is full of null colors.

Just a curiosity, I'll still fix the code.

0

Share this post


Link to post
Share on other sites

 

 

Thank you so much for the plugin and your effort Toe_head!  :cake:  :mtdew:

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0