Bonjour,
J'essais de récuperé l'image d'un richTextox via DrawToBitmap mais l'image est toute noir.
code:
Bitmap bmp = new Bitmap(box.ClientRectangle.Width, box.ClientRectangle.Height);
using (Graphics G = Graphics.FromImage(bmp))
{
using (SolidBrush brush = new SolidBrush(Color.FromArgb(1, 1, 1)))
{
G.FillRectangle(SystemBrushes.Control, 0, 0, box.Width, box.Height);
}
}
box.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
bmp.Save("image.jpg", ImageFormat.Jpeg);
Quelqu'un pourait il me dir ce qu'il ne va pas ?
Merci.