特别是当我为我的 html 模型制作 css sprites 时,我使用 Paint.Net 专注于选定的图标并读取左侧和顶部以及宽度和高度像素值。所以我可以在我的 CSS 类中使用它们。
有没有简单的方法可以将左侧和顶部的值复制到我的剪贴板中,并且我不需要每次都手动输入?
这是我的问题的SS;
抱歉,目前不可以。
我尝试为您编写一个插件,将鼠标坐标复制到剪贴板,或显示适当的消息框,但这是不可能的,因为插件不能使用 C# 'using' 关键字。
您可以写信给paint.net作者您的功能请求 - 他们很容易添加到程序中
无论如何,代码看起来像:
#region UICode
bool Amount1 = true; // [0,1] Copy to clipboard
bool Amount2 = false; // [0,1] Show popup
#endregion
void Render(Surface dst, Surface src, Rectangle rect)
{
Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
int a = System.Windows.Forms.Cursor.Position.X;
// or int a = Selection.Left;
int b = System.Windows.Forms.Cursor.Position.Y;
// or int b = Selection.Top;
if (Amount1)
{
Clipboard.SetText(a.ToString() + ", " + b.ToString());
}
if (Amount2)
{
MessageBox.Show(a.ToString() + ", " + b.ToString());
}
}