How to set an image size in pixels in WPF? - wpf

I am using 32x32 pixels images in a toolbar in WPF. How can I set the width of the images to be exactly 32x32 pixels instead of DPI system ?
Thanks!!

See the reference of the size properties, you can qualify them.

Related

WPF Image width and height ratio

I have listview of images in different resolution. I would like to do something that width of picture will be auto and heigth will be 75% or something of width. Images will be autoscale to this resolution.
You could create an IMultivalueConverter instance, which would accept the ActualWidth value of your ListView, and the image itself.
The converter would manipulate the Bitmap and it could be rendered with the desired parameters.

My WPF icons are displayed very small

My WPF icons are displayed very small, as you can see in this image, can you please
suggest what could be the problem? I tried to find some properties related to size but
no success.
One problem could be the bitmap's resolution. Open the bitmap for example in Paint.NET and in the Resize Bitmap dialog check whether it is 72DPI or 96DPI. A large ribbon bitmap should be 32x32 Pixels at 96 DPI.
By the way, in your screenshot the bitmaps actually look ok. What makes you think they are too small?
WPF uses an unusual resolution of 96 dpi... I'm guessing that your images have not been saved at this resolution.

WPF Resize Image - Fixed with, sliding height

I have an image in WPF which I would like to enlarge to a fixed width (say 800px).
The image should stretch to this width using the original aspect ratio (so not as to distort) and the height should be scaled as necessary.
If the height is not too large for the container the top of the image should show at the top of the container. The image should then slide upwards until the bottom of the image reaches the bottom of the container via an animation (so at some point the whole image has been displayed).
Links or suggestions highly appreciated

System largest font size cropping wpf menu

From the Display Properties dialog in the Control Panel, if I change the font size property to Extra Large Fonts, the menus in my WPF application become cropped as shown in the image below:
How do I fix this?
TIA.
If should set that with top margin negative
Grid rows containing menus were being set to fixed heights. Changing the height of these rows to Auto solved this problem. Thanks to BalamBalam for the tip.

Maintain Aspect Ratio in a Silverlight Image

Ok .. so here's the scenario. I've got a WP7 silverlight app, that loads an image from the net. Now, these images will be taken from mobile devices, so they may be in portrait or landscape mode. Certainly not a square.
Is there any way to maintain the aspect ratio when I show these in a silverlight <Image> control?
I'm ok with either of two resolutions:
That the image shows up in its correct aspect ratio within a predefined box that I've defined in xaml
Or that the image is cropped into the square
The way silverlight was built, you can set the width OR the height on the image, it will automatically max out whatever property you set and calculates the other side of the image so that it keeps the aspect-ratio.
So, just set a width on the image and center or right,left,top,bottom align it. (do not stretch it).

Resources