2016년 11월 16일 수요일

Problem saving canvas


I have programmed a drawing app with AI2 and it works as expected except the save canvas feature. Whether I save as .jpg or as .png, it gets the aspect ratio wrong (most of the time). The correct dimensions for my canvas are width 320 by height 355. However, most of the time it saves as 320x110. The save block is enclosed. Any thoughts on what could be going wrong?

Thanks, Bob
-- 
Post your canvas component settings. Also if you can, please post the aia file. It may happen that the canvas save works differently in different devices. Did you try it in a different device?
By the way, you can optimize your blocks a little by doing this:



-- 
Check for Screen1 extra real estate hogs like the Title Bar that might be throwing off size calculations.
They can be turned off.
ABG


-- 
Italo -- thanks for the optimization suggestion -- I like it. BTW, I am not sure what the aia file you requested is.
Abraham -- thanks for your suggestions as well.
Before I do anything more, I plan to build the app and run it directly on my device to rule out network communication problems. I will post the results and if the problem is not solved, I will post the canvas component settings and the aia (if you will tell me where to find it.

Thanks, Bob

-- 

 

-- 
I tried building the app and running it directly on my device (Alcatel One-Touch Pixi Pulsar), but did not solve the problem.
I changed the screen orientation property from unspecified to portrait -- did not solve the problem.

I eliminated the "when notifier.after text input" block and put the "canvas.save" block into the "when save(button).click" block as shown below and this did work. The saved file has the correct aspect ratio but of course the image filename is hard coded. I cannot see how to capture the filename as a variable that can be provided to the canvas.save block without using "when notifier.after text input".


I get the wrong aspect ratio when implemented as below:


As requested, I am including a screen capture of the canvas properties and have enclosed the aia file. BTW, I was unable to open the aia -- what application do you use to view this file?


Sorry for this very long reply but I'd really appreciate your help.


Bob


-- 
I think you are overloading Notifier1 with too many jobs.

Hire a new Notifier named NotifierFileName whose sole job is to ask for the file name,
and for its result event block build up the file name with a text JOIN then save the canvas
under the JOIN result.

This will reduce the number of rungs in your IF/THEN/ELSE ladder, a good thing.

ABG



-- 

댓글 없음:

댓글 쓰기