ensegre Posted September 6, 2017 Report Share Posted September 6, 2017 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 Quote Link to comment
hooovahh Posted September 6, 2017 Report Share Posted September 6, 2017 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 Quote Link to comment
ensegre Posted September 6, 2017 Author Report Share Posted September 6, 2017 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. Quote Link to comment
ensegre Posted September 6, 2017 Author Report Share Posted September 6, 2017 Oh, it's starting to remind me of another bad trip of mine about customizing controls, maybe I'd better do some real work instead... Quote Link to comment
hooovahh Posted September 6, 2017 Report Share Posted September 6, 2017 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. Quote Link to comment
ensegre Posted September 6, 2017 Author Report Share Posted September 6, 2017 Indeed. Well, enough hacking around unfeatures. One learns nothing doing that, and wastes only time. Thanks for the hints anyway! Quote Link to comment
ensegre Posted September 26, 2017 Author Report Share Posted September 26, 2017 (edited) Ok; still unfeature to some extent, but I'm getting there: 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 September 26, 2017 by ensegre sample ctl indepedent from other typedefs Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.