Ejemplo n.º 1
0
		private void SetPortraitScreenLocationAndSize(Emulator emulator)
		{
			deviceFrame.Image.RotateFlip(RotateFlipType.Rotate270FlipNone);
			Screen.Location = new Point((int)(emulator.ScreenPoint.Y * scale),
				(int)(emulator.ScreenPoint.X * scale));
			Screen.Size = new Size((int)(emulator.ScreenSize.Height * scale),
				(int)(emulator.ScreenSize.Width * scale));
		}
Ejemplo n.º 2
0
		private void SetLandscapeScreenLocationAndSize(Emulator emulator)
		{
			Screen.Location = new Point((int)(emulator.ScreenPoint.X * scale),
				(int)(emulator.ScreenPoint.Y * scale));
			Screen.Size = new Size((int)(emulator.ScreenSize.Width * scale),
				(int)(emulator.ScreenSize.Height * scale));
		}
Ejemplo n.º 3
0
		private void SetEmulatorImageAndSize(Emulator emulator)
		{
			deviceFrame.SizeMode = PictureBoxSizeMode.StretchImage;
			deviceFrame.Image = Image.FromStream(GetImageFilestream(emulator.ImageResourceName));
			if (emulator.Orientation.IsLandscape())
				deviceFrame.Size = new Size((int)(deviceFrame.Image.Size.Width * scale),
					(int)(deviceFrame.Image.Size.Height * scale));
			else
				deviceFrame.Size = new Size((int)(deviceFrame.Image.Size.Height * scale),
					(int)(deviceFrame.Image.Size.Width * scale));
		}
Ejemplo n.º 4
0
		private void SetScreenLocationAndSize(Emulator emulator)
		{
			if (emulator.Orientation.IsLandscape())
				SetLandscapeScreenLocationAndSize(emulator);
			else
				SetPortraitScreenLocationAndSize(emulator);
		}
Ejemplo n.º 5
0
		public void UpdateEmulator(Emulator emulator)
		{
			Screen.Dock = emulator.IsDefault ? DockStyle.Fill : DockStyle.None;
			if (emulator.IsDefault)
			{
				deviceFrame.SizeMode = PictureBoxSizeMode.Normal;
				deviceFrame.Size = new Size();
				deviceFrame.Location = new Point(0, 0);
				if (DeviceChanged != null)
					DeviceChanged();
				return;
			}
			string scalePercentage = emulator.Scale.Substring(0, emulator.Scale.Length - 1);
			scale = Int32.Parse(scalePercentage) * 0.01f;
			SetEmulatorImageAndSize(emulator);
			SetScreenLocationAndSize(emulator);
			if (DeviceChanged != null)
				DeviceChanged();
		}