First time here? Check out the FAQ!
x

Can I display a png in a Tool?

0 votes
283 views
I was wondering if it's possible to use a png in a view. I'd like to use it as background to draw lines on it.

Thanks!
asked Dec 15, 2015 in Capytalk & Smalltalk by kymaguy (Virtuoso) (10,580 points)

1 Answer

0 votes
 
Best answer
If you look at the example Tool called:

Kyma:Xtra Tools:widget sampler.pci

you'll see how to create a GraphicContext and save it in a variable called graph.  Then you can use an expression of the form:

(KymaLook readPNG: 'hilbertTransform.png') displayOn: graph.

to display the image in a .png file on that graphics context.

I have added this as an example in the 'widget sampler.pci' found in the Xtra Tools folder of the Kyma folder.  Look in the InitialState, the TriggeredResponse called (ListSelection == 'Blue Pill').
answered Dec 15, 2015 by ssc (Savant) (128,080 points)
selected Jan 12, 2016 by kymaguy
...