
You have to use larger images for VGA or WVGA, or scale your UserControl, and you don't know where is your code running?
For dealing with high DPI (Dots Per Inch) VGA devices, we used to detect the high resolution this way:
private float DetectResolution1()
{
float scaleFactor = 1.0f;
using (Graphics gr = this.CreateGraphics())
{
scaleFactor = (gr.DpiX == 192.0f) ? 2.0f : 1.0f;
}
return scaleFactor;
}
But never use this code if you want to save CPU time.
Ten times faster way is here:
private float DetectResolution2()
{
return this.CurrentAutoScaleDimensions.Height / 96.0F;
}
My code is available here: http://winmobile.euweb.cz/#Post14
If you are developing your custom control, I advise you to read more about UserControl.ScaleControl(..) method, which is called often by the system, so take care with method.
protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
{
m_ScaleFactor = factor;
base.ScaleControl(factor, specified);
}




