Don't auto scale zoomable picture box - c#

I’m writing in c# with Visual Studio 2013. I need to have a pixelPictureBox that the user can zoom (1:1 only) and move what parts show. I also want to make the window it’s in scalable and allow more or less room for the picture. However, this is causing white space to be added when the 2 shapes don’t match, which is not OK. I can take care of properly scaling the pixelPictureBox, but I need to stop the automatic scale from happening. Is there any way to do this? Thanks!

This looks like it's actually a problem with the display panel size and the image size. Before I've zoomed it, the image is bigger than the display area but it still wiggles with a bit of white space when the user drags it one way or the other.

Related

How do i programmatically create a kind of arrow that points to the buttons like a flow

I am creating an Accounting software on C# WPF and I want this kind of arrow pointing to buttons like a flow structure in the picture.
And want that to be responsive.
I tried using png images of different sizes to show but its very hard and a lot of hard codes and some don't work as expected.
Please tell me a way to create it.
I know path class little bit but don't know how to make resize according to the screen size

Windows forms dynamically evenly distribute controls?

I am making a lot of camera tracking applications. I want to open the selected cameras in a layout. But mostly one camera will be watched. But I also have to do something to watch multiple. I want the screen to be divided into 2 when there are 2 cameras and when there are 3 cameras, the screen will be divided into 4. I couldn't do it with FlowLayoutControl. Because it is necessary to give dimension to the video control that I added. How should I do such a thing. I'm adding a screenshot of the fixed size control insertion part. I did the thing in the image but gave 200x200 dimensions to the controls inside. This is not what I really want to do. I want controls that change dynamically in size according to the number of controls. How do i do this?

Scaling images in a picture box visual studio

I'm working on a program where you can make 8-bit sprites and then use them to make a map. The problem is when I put them in the picture boxes (used as tiles for the map editor) they become blurred due to the scaling. Is there any way to get around this? (I'm using visual studio windows forms and c#)
Just make sure you set the SizeMode of your PictureBox properly for your scenario.
As you do not want to scale them, I suggest you put them to Normal or Zoom
Normal with align the picture on the TopLeft position of the PictureBox. Zoom will stretch, but maintain the ratio (thus it wont be overly blurry)

Unity/2015 Macbook Pro (Retina) Build Has Different View Than Simulator View

I've been through a few of the suggestions that have been posted recently, some suggesting to switch the Canvas UI from Constant Pixel size to Scale With Screen Size, but this is not working. No matter what I seem to do, I can't get the content to display in the build window the same way it did in the Unity simulator. I'm new to Unity and game design, so please forgive me if I'm missing the obvious.
Also, a sidenote, my fonts seem to be much fuzzier than I would expect. I have to crank down the character size to almost the bare minimum, then increase the font size a ton for them to be even halfway decent.
The problem has to do with the fact that your unity editor is set to free aspect.
This means that you can resize the editor however you want and it will change the resolution but ONLY in the editor itself. If you want to fix that, you can click where it says "Free Aspect" and either set it to a ratio (like 5:4, or any of the default options) or you can click the plus bottom at the bottom of the list and add a fixed ratio so you can see exactly what it would look like with that screen resolution.
Obviously change the width and height to what you want. Then make sure you select that. That will make the editor show you exactly what will show in the build for that resolution.
Once this is done you change actually change the build settings so it only runs in that resolution for the build as well.
As for the text being fuzzy, I have always had to do what you did as well, so sadly no help from me there.

Drawing a lot of lines and other shapes in WinRT App

In my WinRT app I need to draw about 3000 objects on a canvas, where I can translate and zoom the view. Unfortunatley, after adding about 1500 lines to my canvas my Windows 8 App always crashes. What could be the best practice to achieve this?
One solution could be rendering everything on an image (how do I do this?). But then I loose comfort of easy access and editing of every element.
Also my scale and translate is very slow. But since I also need a big overview, it makes no sense to put only the objects of the visible area in the canvas, since on minimum zoom it's still everything and zoomed it's still very laggy cause of add and remove operations.
There are a couple of different things you should employ to have a smooth UX:
Use a Quadtree, whenever you add a shape to your canvas you also put it on your Quadtree. This will be helpful when you will zoom on a portion of the image: you will know what objects are in this portion of the image; you will render them again (against using a cached/pixellated version).
To overcome the potentially lengthy drawing process you could do the following:
display the portion of the cached image overview at the right scale
use a progress indicator to let know the user that the program is working render this portion
when the faint rendering is done, blit it on the screen
A concrete example: Google Maps does that.

Categories