Hey everyone I wrote something similar in MATLAB before I found this (dont have Fireworks either) if you have MATLAB hope this helps, if not I can try to compile it into either a .exe or a .app
John
EDIT: Looks I’d only be able to compile in .exe which kinda sucks…
[code]
function outStr = getImagePoints(filename, n, scale)
% Instructions:
% When the figure window appears place the cursor over the image and click
% where you want the edge points to be, after you have selected ‘n’ points
% (maximum of 8) the figure will disappear and the text string will appear.
% Only works with *.png images currently.
%
% Points must be chosen in a counter-clockwise direction or will not be
% compatible with Corona!
%
% Inputs:
% filename - path to file (png works best)
% n - number of points to take
% scale - if the image in Corona is half then use .5 if it is twice the
% size use 2
%
% Maximum number of points: 8
if n > 8
error(‘Maximum number of points: 8’)
elseif ~strcmp(filename(end-3:end), ‘.png’)
error(‘Not a *.png file’)
end
% Import the image data
img = importdata(filename);
imgFields = fieldnames(img);
% Plot the image
if strcmp(imgFields{2}, ‘alpha’)
image(‘CData’, img.cdata, ‘AlphaData’, img.alpha)
else
imshow(img.cdata,img.colormap)
end
% Draw a line through the center of the image in each axis
%hold on
%plot([0 0], [-10 10])
% Convert the values from x and y into the Corona coordinate system
xdim = size(img.cdata,2);
ydim = size(img.cdata,1);
% Draw a line through the center of the image in each axis
hold on
plot([xdim/2 xdim/2], [0 ydim])
plot([0 xdim], [ydim/2 ydim/2])
% Get the points from the user
[x y] = ginput(n);
xlim([0 xdim]);
ylim([0 ydim]);
close all
x_out = round((round(x) - xdim/2)*scale);
y_out = round((round(y) - ydim/2)*scale);
% Format the points to match the Corona syntax
outStr = 'ObjShape = { ‘;
for i = 1:numel(x_out)
if i == numel(x_out)
outStr = [outStr num2str(x_out(i)) ‘,’ num2str(y_out(i)) ’ }’];
else
outStr = [outStr num2str(x_out(i)) ‘,’ num2str(y_out(i)) ', '];
end
end
[/code] [import]uid: 17878 topic_id: 4864 reply_id: 24322[/import]