프로그래밍 Q/A 사이트이므로 JavaScript로 작성하는 방법을 알려 드리겠습니다.
#target photoshop
// Save the current unit preferences (optional)
var startRulerUnits = app.preferences.rulerUnits
var startTypeUnits = app.preferences.typeUnits
// Set units to PIXELS
app.preferences.rulerUnits = Units.PIXELS
app.preferences.typeUnits = TypeUnits.PIXELS
// Use the top-most document
var doc = app.activeDocument;
var coords = doc.selection.bounds;
// Write coords to textfile on the desktop. Thanks krasatos
var f = File('~/Desktop/coords.txt');
f.open('w');
f.write(coords);
f.close();
// Reset to previous unit prefs (optional)
app.preferences.rulerUnits = startRulerUnits;
app.preferences.typeUnits = startTypeUnits;
이 직사각형의 경계를 줄 것이다 현재 활성 문서의 선택 (변환 할 때 표시되는 경계 상자의 생각) :
은 선택 경계의 구형 좌표를 얻으려면 가장 쉬운 방법입니다. minX, minY, maxX, maxY 순서로 출력합니다. 이것은 CSS 좌표로 변환하기에 충분한 정보 여야합니다.
#target photoshop
// Save the current unit preferences (optional)
var startRulerUnits = app.preferences.rulerUnits
var startTypeUnits = app.preferences.typeUnits
// Set units to PIXELS
app.preferences.rulerUnits = Units.PIXELS
app.preferences.typeUnits = TypeUnits.PIXELS
// Use the top-most document
var doc = app.activeDocument;
// Turn the selection into a work path and give it reference
doc.selection.makeWorkPath();
var wPath = doc.pathItems['Work Path'];
// This will be a string with the final output coordinates
var coords = '';
// Loop through all path points and add their anchor coordinates to the output text
for (var i=0; i<wPath.subPathItems[0].pathPoints.length; i++) {
coords += wPath.subPathItems[0].pathPoints[i].anchor + "\n";
}
// Write coords to textfile on the desktop. Thanks krasatos
var f = File('~/Desktop/coords.txt');
f.open('w');
f.write(coords);
f.close();
// Remove the work path
wPath.remove();
// Reset to previous unit prefs (optional)
app.preferences.rulerUnits = startRulerUnits;
app.preferences.typeUnits = startTypeUnits;
지침 :
- 오픈지도
는 경로와 출력이 스크립트를 사용하여 경로의 각 pathPoint.anchor로 선택을 할 수있는 개별 다각형 점의 좌표를 얻으려면 너무 수정 ExtendScript으로 스크립트 -run 당신의 마음에 드는 선택 도구
를 사용하여 지역의 선택 -make 이미지
lkit을 선택하거나 파일> 스크립트> 찾아보기 ...를 선택하고 스크립트가 저장된 .jsx 파일을 선택하십시오.
좋은 질문입니다, + vote from me. – Hoque
그래서 [[this]] (http://davidlynch.org/projects/maphilight/docs/demo_world.html)와 같은 것을 원하십니까? 나는 자바, 또는 jQuery와 같은 것을 사용하는 것을 생각할 것이다. 보십시오 [여기] (http://davidlynch.org/projects/maphilight/docs/) 어쩌면. 도움이 될지 모르지만 뭔가 있습니다. – ACarter