I´m designing an desktop app in WPF. My problem is the resolution, the minimum resolution that can support the app is 1024x768(for crt monitors) and in this resolution maximizing the app seems okay and good, but when i try the app in higher resolution then the gap between my components and their size according to resolution seems very very awful and unprofessional specially in very high resolution the empty space which make it more worst and ugly. please suggest me some easy fast guide or documentation please.... thank you
When designing your WPF application, it's advisable to use one of the predefined layouts such as stacklayout, grid, dock panel etc. as these tend to be more responsive than defining the your own static layout.
Check the link below on how you can use these layouts.
https://wpftutorial.net/layoutproperties.html
Related
More precisely, when I use certain display scales in Windows (those that don’t produce perfect 1:1 pixel layout. 150%, 175%, etc), the text doesn’t always redraw itself in the exact same position during every redraw. It is as if it dances a bit. However, if I scale the display perfectly (100% or 200%, for example) the effect is nonexistent.
Is there a fix for this? I spent so much time developing a custom text editor with Win2D’s CanvasControl being used draw the UI text, then discover this. I absolutely cannot continue development under these circumstances, as I am not aware of a better alternative to Win2D’s CanvasControl for presenting text for a custom text editor.
Any advice helps! Thanks!
UWP is optimized for high resolution. The unit used is effective pixels (epx). In different resolutions, the application will scale accordingly.
In order to apply consistent performance at various resolutions, there is a very important concept:
The sizes, margins, and positions of UI elements should always be in multiples of 4 epx in your UWP apps.
So you can check your app and resize text and controls to fit this principle.
See more in this document: Introduction to UWP app design
We have a bunch of forms with alot of PictureBoxes on them. They're basically a representation of an engineering system with pipes connected to pumps and whatever. Each element is it's own picturebox, so there's a few hundred.
The problem we have is that when we take the app to a large 40"+ TV, there's too much space everywhere and it doesn't look the way it does on the developer's screen. So we designed it for these large TV's but when we look at it on a normal computer screen it's all wrong.
So how do we design the form with pictureboxes for the actual images to resize and reposition the controls relative to the size of the resolution it's being viewed on? If we simply anchor everything then the image sizes themselves are not relative to the display it's seen on.
Much appreciated!
In a Winforms solution you will have to do at least some of the resize calculations if anchoring and docking do not provide you with the required results.
If it is really important to you to be able to design the UI in Visual Studio I recommend writing custom controls that expose the desired resize properties and resize behavior and perhaps even a custom designer to support the design time features.
It might not be feasible but you could consider having a look at WPF, it has a ViewBox control that might simply be the answer to your needs.
A lot of them have hard coded square small and 2 squares sized large tiles. I am looking for something flexible enough for at least the size ratio to be adjustable to be more flat.
Telerik has a flexible approach (you can choose any row and column span for a tile) but their implementation is either laughably primitive is still too new, especially the drag and drop part.
Devexpress has nice drag and drop, but is stuck doing 1x1 and 1x2 sized tiles.
DevComponents is my favorite. With WPF, you can copy most of the XAML you would otherwise use in a Metro application - so don't feel that you can't emulate Metro on the desktop. Many have already done it. Certainly, many more will.
But there are some downsides to Desktop development. Although desktop development is very powerful, and it is, Metro development in Windows 8 has considerable advantages. Having said that, desktop development can take advantage of Visual Studio 11, too.
I'm using the Devcomponents DotNetBar. It has pretty flexible Metro tiles.
metro-ui should be used with WPF and that will work great there too.
If you want to implement Metro-UI in windows from you have to create your own user control.
I've been writing a small desktop gadget-type application that displays scrolling text along the bottom of the screen (Similar to the old CNN news ticker), however the performance of GDI is just unsatisfactory (As high as 8-12% on a quad core and 20% on a single core) even after I've attempted to clean out bottlenecks.
I was considering using OpenGL instead to render everything, but I don't know if that is a reasonable option to require users to have hardware acceleration for a tiny app like this.
Does anybody have any input on this?
If you're comfortable with using OpenGL and your intended users are happy with the additional dependencies that OpenGL brings then I say go for it. :)
In terms of staying with GDI, I'd make sure you're rendering the text a few times as possible (through such techniques as rendering to bitmap and just scrolling that instead).
If neither one of those two options sounds appealing then there's always DirectX.
You could write the app in WPF and let WPF handle the acceleration for you (it's backed by DirectX).
I wouldn't want to install open gl for a program like that. You say that you "attempted" to eliminate the bottlenecks, but it does not sound like you succeeded. Like lzcd mentioned, there are other ways to scroll text than to repaint it constantly. Why not just draw to a bitmap and scroll that?
I'm working on a C# application that needs to use Direct3D in a control in a windows form,
AND (at the same time) fullscreen on a secondary monitor.
Basically, I want a Windows Forms application on one screen with a user-interface to control the graphics, and I'd like to show preview-graphics in a small control, and full-blown superduper megafancy graphics fullscreen on a secondary monitor.
What's the best way to approach this?
(For example, I know XNA can render in a Windows Forms control, but is it possible to then add a fullscreen window on another monitor as well?)
AFAIK the only way to do this is to create 2 complete Direct3DDevices. You create one as fullscreen on monitor 2 and then you create the other as a normal windowed device. This should do what you want. Be warned, though, that you won't be able to share resources between the 2 devices ~(They will need to be created on each) and that performance will be worse than having 2 full screen swap chains on one device.
I know you said Windows Forms, but I will still suggest you use WPF. The advantage is that you will be able to use the same technology for both windows.
WPF is a very nice replacement for traditional windows forms. It also stimulates you to design better solutions with better separation of model and view.
On the other hand, WPF is all rendered on top of directx. It provides you with a nice 3D engine where you can easily implement all sort of things, for some examples, take a look on the following links:
http://www.codegod.de/webappcodegod/render-3ds-3d-models-with-wpf-and-xaml-AID433.aspx
http://www.wpftutorial.net/IntroductionTo3D.html
You can't have true fullscreen like that (as far as I remember), but you can make a border-less window which you can then make as big as the screen itself. It will look as if its fullscreen, but you will still suffer from windowed-mode performance penalties. (they are acceptable)