Is there any new or easier way to edit the Alpha Blend Mode in Windows Forms so that transparent PNG images with "shadow" can be used as a background image for the Windows Form while persisting complete transparency and shadow effect?
NB:-
I've tried the TransparentKey and
OverRiding OnPaintBucket too
Over time I realise that for a more intuitive and elegant UI, Windows Presentation Foundation (WPF) offers more possibilities, than Windows Forms.
Nonetheless, there are several Windows Forms libraries available to suit the need for elegant UI in windows desktop programming.
e.g DevExpress etc
Also here is an article posted on CodeProject attempting the Windows Forms Alpha blend mode
Related
I'm starting to get really confused by the different ways to recognizer text. Some are ancient and some are for Windows Forms or WPF ...
Today, if I only need to traget Windows 10 what Ink technology should I use?
I've been trying to use InkCanvas and all the docs talk about InkPresenter.
However InkPresenter is not a member of InkCanvas ...
InkPresenter
Any ideas please?
InkCanvas is a WPF control and InkPresenter is a UWP control. Which one to use depends on what kind of application you are developing.
These are different kind of applications. A classic WPF desktop application runs on all Windows PCs including Windows 10 machines while Universal Windows Platforms (UWP) apps have the potential of running across all Windows 10 devices including phones, HoloLens and XBox: https://learn.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide.
I'm trying to change Windows 8.1 (desktop) lock screen image from WPF application.
I've found solution with Windows SDK approach, but it uses runtime application as example (actually, all information I've found was regarding to WinRT apps). But I don't want to use WinRT - all I want is to use LockScreen class in plain old WPF.
After all I have managed to do this in the WPF app several times. This included:
1) manually adding <TargetPlatformVersion/>8.1</TargetPlatformVersion> into .csproj as suggested here;
2) adding references to Windows and System.Runtime.WindowsRuntime as suggested ibid;
3) following these steps to change lock screen background
Then I've faced the problem with platform - application does what it should only with x64 platform (not anyCPU). And not each time (I could not determine consistency yet).
Any way I think that I am over-complicating the solution. Does anyone have other suggestions? Is there any other simpler/cleaner way to change Windows 8.1 lock screen image via WPF application?
I have just started to develop in universal app. I have developed app in Windows 8 store apps and also developing Windows Phone 8 and Windows Phone 8.1 (SilverLight) Apps. Question is related to universal app in Windows and Single UI which is created in App. Share folder.
1 For web there is word like responsive UI. to create there is media query to write css.
I know css is same as we can create resource with for xaml . I can get resolution form c# and I can create different UI for different resolution and I can visible collapsed according to resolution but is there any single way which automatically adjust according to design.? ( this question is related to data binding controls specially...)
There are several techniques to adjust the page's design to the size, shape, and resolution of the window. These are usually used together.
The first is to use dynamic layout controls instead of hard-coding positions. For example, use a Grid control with * columns to split the screen by percentages, or a StackPanel to stack controls so they as they fit. GridViews can scale to fill the screen (and beyond). This will let the app flow to use the available space.
MSDN discusses this technique in Quickstart: Defining layouts
For larger scale changes where the app should make bigger changes to adjust to larger changes such as portrait vs. landscape vs. snapped modes you can use Visual States. Visual States allow the app to set a specific state (e.g. "Landscape") which automatically changes properties of the page's controls. For dynamic layout the visual states will typically hide and show different controls, for example to switch from a horizontally oriented GridView in Landscape mode to a vertically oriented ListView in Portrait mode. By data-binding both controls to the same data the code-behind doesn't need to know any details about which controls are used at any specific time.
MSDN discusses this technique in Quickstart: Designing apps for different window sizes
Blend has a very good Visual States editor that you can use to define and set up different visual states visually.
The same techniques and code apply to Windows Store apps and for Windows Phone Store apps, but the exact layouts are likely to be different to cater to the different device sizes. Windows Store apps run on a wide range of display sizes and users can resize Windows Store apps freely, so Windows Store apps need to support much more flexible layouts than Windows Phone Store apps. Windows Phone Store apps need to take display resolution into account, but run on fairly consistent aspect ratios which change only for portrait or landscape.
For very simple apps you may be able get away with sharing a single Xaml page in the Shared project of a Universal app, but in most cases you'll be better off with separate page designs for Windows Store and Windows Phone apps. In addition to the screen size differences, there are a few control differences that will require separate Xaml. Xaml doesn't support conditional compilation, so a Shared Xaml file would need to be exactly the same in both.
For Windows Store you can use 'visual states'. You can set rules that determine which visual state is to be used, e.g. when the width is 320 switch to snap mode and modify the layout to suit.
Be careful when looking up information on this because the paradigm changed a lot between Windows 8 and 8.1.
Jerry Nixon has a great tutorial on visual states:
http://blog.jerrynixon.com/2013/11/windows-81-how-to-use-visual-states-in.html
This post from my blog covers a simple scenario using code behind only (VB, but should be easy to change to C#) - not advisable when you have a complex layout:
http://grogansoft.com/blog/?p=116
And there is a sample somewhere amongst these on the Windows Dev Center:
https://code.msdn.microsoft.com/windowsapps/Windows-8-Modern-Style-App-Samples/view/SamplePack#content
For the phone version(s) you should probably not bother with visual states as a phone app always has the full screen, and it's a better user experience to lock the display to either portrait or landscape.
Your phone/Store apps can share controls, but they have their own pages. I usually create full sized and smaller versions of any data-bound controls and use the smaller size on the phone and when the Store version is in a small state (e.g. 1/2 the screen).
I 'am developing an app targeted to WP7.1 but I want it to work well on WP8 devices too. Assuming creating layout using dynamic resizng elements (grids with auto height etc) will the app scale just like WP8 app under Windows Phone 8 (WP8 handles WVGA HD WXGA resolutions)? If yes, is this possible to get a exact screen size under WP7 and what about in-app images in high resolution? If not, should I build 2 different apps to handle scaling well? One for WP7 and another for WP8 (even if the only change is build target?)
WP7 only supports 800x480 resolution and will automatically scale on WP8.
WP7 app cannot however do any resolution dependant tweaks when app runs on WP8. You need to recompile it to WP8
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)