Scaling of the sprites or images

0 votes
asked Mar 4, 2016 in Wanted features by habdank (750 points)
Dears,

Is it posible to scale sprite "on the fly".

Actually it is quite unconfortable to generate sprite of the icon for quite much of sizes like 16, 32, 64, 128, 256, ... px.

And then use ONE of those correctly in the diagram.

Is it possible to scale sprite? I mean when I have e.g. sprite with 128 px size, and then I want to have on one diagram something like 16 px icon, and on the other 128 px icon.

 

I had also tried to use <img> HTML tag skipping sprites, as HTML tag (according to W3C) has possibility to scale like:

<img src="icon.png" width="16" height="16">

but this one does not work in PlantUML. I can only use images also without scaling.

<img:icon.png>

 

Do you have some hints?

 

Best regards,

Seweryn.
commented Mar 20 by stephan (390 points)
Scaling of images is a feature I also would enjoy very much.

Any progress on this? Maybe it is already possible =)

1 Answer

+2 votes
answered Mar 20 by plantuml (134,510 points)
selected Mar 21 by habdank
 
Best answer

Yes:  We code, but we forget to document :-)

You can have:

@startuml
sprite $foo1 {
  FFFFFFFFFFFFFFF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  F0123456789ABCF
  FFFFFFFFFFFFFFF
}
Alice -> Bob : Testing <$foo1{scale=10}>
@enduml

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuIekACeiILLGISlFDrIevb9GS4C58143GoDZ4rCpSmjBHoVdGI22vi9QBiUSpEHK1Lqx1QVy90KhXP3KufBCl7G56x2lgekJ4tDIRGqDQksu75BpKe2-1W00

It should be working for image also

commented Mar 20 by stephan (390 points)
faster than expected =)
thanks a lot
...