本文介绍了从C#程序在photoshop中打开图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨大家好
i希望在c#中制作一个程序当我选择一个在photoshop中打开它的图像时我可以将任何参数传递给它放大spicified position ...请帮助
hi every body
i want to made a program in c# the when i select an image it open it in photoshop and i can pass any parameter to it like make a zoom in spicified position ... please help
推荐答案
// check for document has length
if(app.documents.length > 0)
{
// original code by Filip Van Tendeloo
// as cited in the article at:
// http://coding.smashingmagazine.com/2012/04/11/css-sprites-revisited/
// get active document
var psDoc = app.activeDocument;
// get user input on column count
var colWidth = parseFloat( prompt("Column size?", 60.0) );
var docWidth = psDoc.width;
// determine number of columns
var colCount = docWidth / colWidth;
// create vertical guidelines
for(i = 0; i < colCount; ++i)
{
psDoc.guides.add(Direction.VERTICAL, i * colWidth);
}
// extensions to Filip Van Tendelo's original script by Bill Woodruff:
// get user input on row count
var rowHeight = parseFloat( prompt("Row size?", 60.0) );
var docHeight = psDoc.height;
// determine number of rows
var rowCount = docHeight / rowHeight;
// create rows
for(i = 0; i < rowCount; ++i)
{
psDoc.guides.add(Direction.HORIZONTAL, i * rowHeight);
}
}
这篇关于从C#程序在photoshop中打开图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!