Created
June 19, 2013 11:11
-
-
Save jongalloway/5813533 to your computer and use it in GitHub Desktop.
Sample Emulator - Original
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void OnPaint(PaintEventArgs e) | |
{ | |
// Paint the LCD control. Use the contents of the LCD if available; | |
// otherwise call through to the base class. | |
if (_bitmap != null) | |
{ | |
// Synchonize access to the bitmap with the .NET Micro Framework | |
// thread. | |
lock (_bitmap) | |
{ | |
// Draw the LCD contents. | |
e.Graphics.DrawImage(_bitmap, 0, 0); | |
if (m_currentGesture == TouchGesture.Rotate && | |
(flags & (TouchSampleValidFlag | TouchSampleDownFlag)) == (TouchSampleValidFlag | TouchSampleDownFlag)) | |
{ | |
e.Graphics.DrawEllipse(Pens.Red, _lastMouseDownX - c_GestureRotateXOffset, _lastMouseDownY, 3, 3); | |
} | |
} | |
} | |
else | |
// We have no private LCD bitmap, because the .NET Micro Framework | |
// hasn't called OnDevicePaint yet. | |
{ | |
base.OnPaintBackground(e); | |
} | |
if (this.DesignMode) | |
{ | |
// At design time, paint a dotted outline around the control. | |
OnPaintDesignMode(e); | |
} | |
base.OnPaint(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment