Jump to content

scalable picture ring


ensegre

Recommended Posts

Just to make sure: I'm playing around with a graphic state indicator, and I would like to make it resizable. I thought at a Pict ring, created some proof of the concept svg images with Inkscape, saved them as wmf, customized the ring importing at the same size one image per state (this works apparently only under windows). I got the what attached, but the images don't scale when I resize the indicator. At best, I can import a wmf file for the background (currently white), and that does resize, but is common to all states.

Am I missing some obvious trick, or is this the best one can aim to?

GateState.ctl

Link to comment

I've posted this several times now but figured I'd give it a try to see if it works with vector images and the first EMF I tried it on appeared to work.  Attached is the .Net image manipulation stuff that demonstrates loading an image into a picture box which supports alpha layer transparencies, ICO and TIF image selection, and zooming with the control which in this demo changes size with the window resize.  Here was the last update I made on the dark side.  This attached example just has an EMF that is included to test with.

Image Manipulation With Ico and Tif Fix emf.zip

Link to comment

Thanks Brian, but I'm asking specifically about a Pict ring (or any other solution which gets close to enum functionality without bothering to concoct an Xcontrol, unless there is no other way). I thought for a moment, would emf vs wmf make the trick, but as you see it doesn't The red X is the background and it resizes, your battery is the element of the ring.

Untitled.png

Link to comment

eah I know you were specifically asking about picture rings, sorry I can't help on that topic.  But I thought showing you an alternate solution that can accomplish a similar UI would help.  Having the other functionality that a pict ring gives might be a pain to implement for sure.  Having a small window pop up on top when the user clicks a picture box might be difficult since the picture box will be rendered as a separate object and often times is forced to be always on top of all other UI elements, but I think that is limited to a single handle, and a separate VI could be used.  I do wish more attention went into the features of the picture ring.  Replicating all of the functionality of a picture ring in an XControl seems like alot of work for just a little added functionality.

Link to comment
  • 3 weeks later...

Ok; still unfeature to some extent, but I'm getting there:

Untitled.png

ThreeStateTurbo.ctl

At least as an indicator, it's quite a solution. The trick was to create a stacked set of customized radiobuttons. As for a control, since one can just click on the topmost, one cannot really chose the state of the ring; but one could think at an Xcontrol for that. Also, to size it you have to drag the correct handle (that of the stack group, not that of the container nor of the individual button), but that is manageable.

This is what put me on the track:

Btw with all this I'm rambling through undocumented unfeatures of custom controls. svg, wmf and emf and quirks. Transparency. Construction and scalability in 32 and 64 bit, windows and linux. DSC polygonal booleans with subparts. Multisegment DSC pipes. Not really "learning", just discovering quirks. I should write a separate post someday... 

Edited by ensegre
sample ctl indepedent from other typedefs
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.