private IPicture GetChooserImage()
{
Image img = ResourceHelper.ChooserButton;
Rectangle rc = new Rectangle(0, 0, img.Width, img.Height);
using (Graphics g = Graphics.FromImage(img))
{
// VisualStyleElement element = VisualStyleElement.Button.PushButton.Normal;
//if (!PaintingHelper.CanPaintVisualStyle(element))
//{
// Draw a non themed button.
ControlPaint.DrawButton(g, rc, ButtonState.Normal);
//}
//else
//{
// // Draw a themed button.
// VisualStyleRenderer renderer = new VisualStyleRenderer(element);
// renderer.DrawBackground(g, rc);
//}
// Draw the ellipsis on the button.
using (Font fnt = new Font(MiscUtils.StandardSansSerif, 9, FontStyle.Bold))
{
TextRenderer.DrawText(g, "...", fnt, rc,
SystemColors.ControlDarkDark, TextFormatFlags.HorizontalCenter |
TextFormatFlags.SingleLine | TextFormatFlags.Bottom);
}
}
IPicture oleimg = (IPicture)OLECvt.ToOLE_IPictureDisp(img);
//m_pixelHeights[oleimg] = img.Height;
return oleimg;
}