Adding simple graphics objects to GladeVCP?

More
10 Jun 2019 16:10 #136483 by andypugh

cmorley wrote: [As Andy says SVG is another way to display different static images.
Would work fine if there isn't a lot of different objects.


It''s worth noting that SVG supports layers, and you can turn layers on and off in Python, so a single SVG file can be quite a responsive graphic.
self.svg.render_cairo(cr = cr, id = '#layer%i' % tab_num)
is the magic incantation I used.

Please Log in or Create an account to join the conversation.

More
12 Jun 2019 13:02 #136721 by RetrofitTools
Unfortunately, each run could have a completely different configuration. I'm not sure how I could effective generate an svg for each. That seems like more of a task than I want to handle!

Thanks... good to know about the layers in svg.

Please Log in or Create an account to join the conversation.

More
12 Jun 2019 13:06 #136723 by RetrofitTools
Chris
Yes, I initially thought about just using the LED symbol, but...

Can an LED be a hollow outline? Most seem to be uniform colored circles.
Is LED position limited to a "cell"? These hypothetical "boxes of goods" could have 2000 symbols in them, in a non-uniform pattern. Can't see how that would be handled well with a typical layout UI grid, unless it can have exceptionally fine granularity... :(

Need to dig into this more, just don't have time yet. I appreciate your input as someone who has already tinkered with it!

Please Log in or Create an account to join the conversation.

More
12 Jun 2019 13:24 #136724 by andypugh

RetrofitTools wrote: Unfortunately, each run could have a completely different configuration. I'm not sure how I could effective generate an svg for each. That seems like more of a task than I want to handle!.


It's certainly a bit of a game, but not difficult in principle.

is a demo of a macro I wrote to programmatically create a multi-layer SVG as input for a DLP printer.

Attached is the VBA class that does the work.
Attachments:

Please Log in or Create an account to join the conversation.

More
12 Jun 2019 14:16 #136729 by andypugh

RetrofitTools wrote: Is LED position limited to a "cell"? These hypothetical "boxes of goods" could have 2000 symbols in them, in a non-uniform pattern. Can't see how that would be handled well with a typical layout UI grid, unless it can have exceptionally fine granularity... :(


One solution I toyed with for my lathe macros was to store the original position of all the controls on the SVG as it was imported, and then scale those positions as the image size changed.

It worked fine, but there was something about it that bothered me (I have forgotten what it was now) and I went to the invisible table grid.

I would not be at all surprised to find that it is possible to embed metadata in an SVG file which can give the display code a clue what to put where, and what to call the result.

Please Log in or Create an account to join the conversation.

Moderators: mhaberler
Time to create page: 0.092 seconds
Powered by Kunena Forum