public void RefreshImgSizeForGraphicDevice()
{
int newwidth=10;
int newheight=10;
//get image size from config
string imgwidth = confService.GetConfigValueForKey("imagewidth");//
string imgheight = confService.GetConfigValueForKey("imageheight");//
// load default value if no value is set or invalid value is set
if (imgwidth.Trim().Length != 0)
{
Int32.TryParse(imgwidth, out newwidth);
}
if (imgheight.Trim().Length != 0)
{
Int32.TryParse(imgheight, out newheight);
}
if (_currentGraphicWidth != newwidth || _currentGraphicHeight != newheight) // if config setting modified
{
//close graphic device and open it again, it will automatically take new size and set them as _current... .
CloseGraphicsDevice();
OpenGraphicsDevice();
}
}