Sizing of viewbox content - xaml

I'm trying to get my head around using a viewbox container. I have a simple viewbox control and within it i have a simple button.
As expected this button is made the size of the veiwbox. How do i re-size the button to an acceptable size yet so it will grow when viewing on higher screen resolutions.

Related

How to prevent image float when resizing bootstrap layout

We have a typical bootstrap SPA that we turned into a React site.
In one of the sections there's an image that appears in the right side of the layout, and it spans the section vertically (takes up about 50% horizontally).
When the window is reduced in size, at some intermediary positions, the image no longer spans the section vertically, making it float above what looks like a margin or a frame, but in fact, it's just the background color of the section whose aspect ratio is not enough to hold the image completely.
Is there a way to prevent this? It seems like the only solution would be to pick images that are have aspect ratios that are more amenable to the half the grid position they are being given.

Make a responsive form in design view (not programmatically)

I am doing a WinForms program which should have a fully responsive design in a full screen.
I get an approach which works more or less well. It consists into calculate a ratio between display screen and original form size.
Then I apply this ratio to the width, left, height, top properties of each control inside the form.
My doubt is about to use a native way for doing this, since, using anchors, the controls keep their same distances with parent control borders, but I doesn't do proportionally, for instance:
Form with 100x100
Button 20x20 located in (10,10)
If I resized the form to 200x200 (multiply by 2), the best approach I can do in design view is keeping the four anchors to the button, so button size will be 120x120 at the same position (10,10), while what I need is a button with size 40x40, at position (20,20), since form size was multiply by 2.
Is it possible with winforms native operations in design view? (Avoiding to make calculations)
Yes it is possible.
Using the Property Dock = Fill you can ask for a component to take all the room in its container.
Now using a TableLayoutPanel, you can define cells to put your components in. And giving cell a percentage size, you can make sure the sizes will change when the form is resized...
Here are more information on these things :
Dock Property
TableLayoutPanel Class
TableLayoutPanel Tutorial

Add a scrollbar to yfiles.canvas.Control

I have a yfiles.canvas.Control, with some nodes inside. However, the number of nodes is getting bigger, and I need to add a scrollbar in order to vertically navigate through them, despite the reduced size in height.
How can I do this? I see that a ScrollBar class exists, but I don't know how to integrate it.
yFiles for HTML comes with scrollbars built in. You can customize their visibility, but by default they will be shown as soon as the content rectangle is larger than the visible area. Maybe calling updateContentRect is all that is missing in your code?

How to build a Head Up Display in OpenSceneGraph that resizes depending on the screen's resolution?

I'm pretty new to OpenSceneGraph and I have the following problem:
I'm trying to build a 2D Head Up Display out of several images, so that it can resize depending on the screen's resolution. That means I have extra images for the corners and one image for the bar that connects the corners and so on.
Well, that's the idea. But I have no clue how to do that in OpenSceneGraph.
Can anybody help me?
So, when the window resizes, you'll get an event from osgViewer telling you about the change.
You need to resize your viewport when the window size changes, so your HUD geometry has some idea of what the pixel-size of the display is (most of the HUD examples setup for a nominal 1024x768 screen and then just let that stretch around as the window is resized, pretending like the new viewport is still 1024x768).
Once you've resized the viewpoer, you need to rearrange your geometry. Your corner pieces need to be laid out at the fixed pixel size you want them to always appear, then you need your connecting elements to change size, horizontally or vertically, to fill the space between the corner pieces. You usually rely on texture stretching or repeating to fill the space as the piece of geometry gets stretched.
If none of that makes any sense, I can describe more.

Producing bigger pages with a font editor for Cocos2d

I use Hiero, java version, because I want to create fonts for CCLabelBMFont.
However, due to my game being on retina display, my font images are big, and they require more than one page. Cocos2d only supports one.
So, essentially, how can I produce bigger pages (canvases)? I don't think Hiero has that feature.
Click on Glyph cache radio button. Then adjust Page width and Page height until it says Pages: 1. Then change the font size to the size you want. Re-adjust page width/height if the new font size increases the number of pages.
p/s: Make sure you adjust page width/height before increasing the size. Hiero will freak out if you suddenly change to a large size without changing the page width/height, and stop displaying the sample rendering. If that happens, you have to close and restart Hiero.