I have a BitmapSource
1690x214 (taken from an EMF file using this code), and I want to use this image as ToolTip
. This is the image displayed using Paint:
So i wrote this code:
BitmapSource bmp = myBitmapSource; // "Dk01Light.EMF"
Image img = new Image()
{
Source = bmp,
Width = bmp.Width,
Height = bmp.Height,
Stretch = Stretch.Uniform,
};
myTooltip = img;
And this is the result:
As you can see, the right and bottom margin are completly different. Why? How can i fix this problem?
bmp.SetResolution(emf.HorizontalResolution, emf.VerticalResolution);
and it works! – Corinnecorinth