Is it possible to set a gradient splash screen?
In example
<MauiSplashScreen Include="Resources\Images\splashscreen.svg" Color="#512BD4" />
i want the background to be a gradient and have a word on it
Tried:
<MauiSplashScreen Include="Resources\gradientWithWord.svg" /> i tried set image, but size is set incorrect
Try to set BaseSize on MauiSplashScreen .
The value of the BaseSize attribute represents the baseline density of the splash screen, and is effectively the 1.0 scale factor for the splash screen from which all other density sizes are derived.
If we don't specify a BaseSize for a bitmap-based splash screen, the image isn't resized.
If we don't specify a BaseSize value for a vector-based splash screen, the dimensions specified in the SVG are assumed to be the base size.
Try
<MauiSplashScreen Include="Resources\Images\splashscreen.svg" BaseSize="128,128" />
Related
Example
The square is a screen and the diamond is an image
Example
In words
I want my image to be located always at the same point of the screen with any resolution and the image resizes only if the image touches the boundaries of the screen and it always resizes with constant propotions of its width and height (say 16:9) (I have a grid drawed on the image and I need to keep cells of it squared).
Summary
I need to resize the image only if the screen size is smaller in width or height than the image is, else never the image never scales.
What I've tried
For the ideal resolution I took 16:9 and I needed to scale my image, as I described above.
I've tried to use any combination of anchors, and the best one I've got is
use Canvas scaler of the canvas with the image with Scale with screen size checked and
Match width or height equals 1
make anchors of the image located in the center of the image. And everything's good except if the width of the image touches the screen left or right boundaries it does not scale.
Otherwise, if I use Match width or height equals 0 the image does not scale if it touches the screen's upper or lower boundaries.
And, finally, if Match width or height equals 0.5, or other between 0 and 1, the image scales always, but I needed to scale it only if it touches the screen boundaries.
I want to set the width of an Image to the width of the screen with 20 DP on both sides with the original aspect ratio in a XAML file (Xamarin Form), I hope it can be device-independent, which on any device, the Image width is the same as the screen width with 20 DP on both sides while maintaining its aspect ratio.
I tried WidthRequest, but it doesn't work.
'<Image x:Name="myImgBox"
HorizontalOptions="Center" />'
Thank you for the help!
SCREENSHOT of the PROBLEM
If you set the HorizontalOptions to FillAndExpand, the image will fill the space available horizontally. You can also change the VerticalOptions.
<Image Source="yourImage.png"
HorizontalOptions="FillAndExpand"
Aspect="Fill" > </Image>
The Aspect property determines how the image will be scaled to fit the display area:
Fill - Stretches the image to completely and exactly fill the display area. This may result in the image being distorted.
AspectFill - Clips the image so that it fills the display area while preserving the aspect (ie. no distortion).
AspectFit - Letterboxes the image (if required) so that the entire image fits into the display area, with blank space added to the top/bottom or sides depending on whether the image is wide or tall.
I am designing a welcome screen for a desktop application using forms in Visual Studio 2005. I have run into a bit of a problem with the splash image. I'd like it to automatically re-size according to the screen resolution of the user. As it stands I have a source image at a high resolution that I have been shrinking in Photoshop to fit the form design window, but when I build and run the application the image is tiny compared to my screen (1920 x 1080). Right now it is placed inside a panel. I tried messing around with the AutoSize options but that didn't do much.
The question:
How can I set the image to automatically re-size according to the screen resolution of the end user?
The picturebox already has this feature. Load the picture and set the property SizeMode.
// correct proportions
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
// or
// larger, but distorted
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
in code or via the property window and the image will fill the complete picturebox. Set the height/width of the picturebox to scale the image like so:
pictureBox1.Width = Screen.FromControl(this).WorkingArea.Width / 3;
I have created a new Bitmap object and now want do draw some text to it using GDI+.
So I call Graphics.DrawString(...).
The problem is that the size of the string depends on Windows 7's DPI settings.
Is there any way to make my text drawing independent of the windows settings?
PS: The DPI settings seem to affect text only. A rect for example stys the same size when changing the DPI...
Just found the solution myself:
The key is to create the font with the parameter GraphicsUnit.Pixel. That way drawing strings gets independent from the system's DPI settings.
You are correct in that the DPI affects only drawable items that are measured in device-independent units. Fonts are typically measured in Points, where 1 point = 1/72 of an inch. Therefore a 10pt font will be the same size in INCHES on each and every screen resolution and will take up more or less pixels depending on the screen resolution and pixel density.
Everything measured in pixels (such as lines, shapes etc) will not be affected by DPI, but the actual physical size will vary depending on screen resolution and pixel density. Changing your code to measure fonts in pixels will indeed ensure that the text is the same pixel size on all screen DPI settings, but if you were to print to a printer you'll find that the text size will vary depending on printer resolution.
Is there a way to show Kinect Depth Image into Full Screen mode? I'm using C# and WPF, the OpenNI C++ example able to show the dept image in full size with out any stretch occur, but when I use WPF, the image gets stretch out.
Currently I'm getting resolution of 640X480, but I want to display it into any screen size or maybe TV. My laptop is 1280X768 but when u make the image full size it get stretced.
Thanks in advance.
As far as I know the hardware resolution of the Kinect cameras is 640 x 480 so there is no way to increase that without stretching.
In WPF it is possible to scale the image in proportion so the dots of the image remain square.
<Image Source="..." Stretch="Uniform" />
or not scale at all:
<Image Source="..." Stretch="None" />
See Stretching Images under Displaying Images in WPF