protected override void OnPaint(WindowlessPaintEventArgs e)
{
PlatformBitmap bitmap = myBitmap.Value;
if (bitmap != null)
{
bitmap.Draw(e.Graphics, new Rectangle(e.Origin.X, e.Origin.Y, ClientWidth, ClientHeight), new Rectangle(0, 0, bitmap.Width, bitmap.Height));
//bitmap.Draw(e.Graphics, e.ClipRectangle,
//if (Transparent)
// e.Graphics.DrawImage(bitmap, new Rectangle(e.Origin.X, e.Origin.Y, ClientWidth, ClientHeight), 0, 0, bitmap.Width, bitmap.Height, GraphicsUnit.Pixel, WindowlessControlHost.TransparentImageAttributes);
//else
// e.Graphics.DrawImage(bitmap, new Rectangle(e.Origin.X, e.Origin.Y, ClientWidth, ClientHeight), new Rectangle(0, 0, bitmap.Width, bitmap.Height), GraphicsUnit.Pixel);
}
}