protected void setBackGroundImg(String anImageName, int aWidth, int aHeight, int aX, int aY) { Stream stream = null; try { stream = AppController.sAssembly.GetManifestResourceStream(anImageName); mBackImage = new DiwiImage(this); Size size = new Size(aWidth, aHeight); mBackImage.size = size; mBackImage.x = aX; mBackImage.y = aY; mBackImage.bitmap = new Bitmap(stream); stream.Close(); draw(); } catch (Exception e) { MessageBox.Show(e.Message); } }
protected void setBackGroundFromFile(string path, int aWidth, int aHeight, int aX, int aY) { Stream stream = null; try { stream = new FileStream(path, FileMode.Open, FileAccess.Read); mBackImage = new DiwiImage(this); Size size = new Size(aWidth, aHeight); mBackImage.size = size; mBackImage.x = aX; mBackImage.y = aY; mBackImage.bitmap = new Bitmap(stream); draw(); stream.Close(); } catch (Exception) { AppController.sEventLog.WriteLine("Error setting background image ({0}).", path); } }
void setBackground() { mBackImage = new DiwiImage(this); mBackImage.x = 0; mBackImage.y = 0; if (horizontal) { Size size = new Size(320, 240); mBackImage.size = size; mBackImage.bitmap = AppController.backgroundHorBitmap; } else { Size size = new Size(240, 320); mBackImage.size = size; mBackImage.bitmap = AppController.backgroundVerBitmap; } }