You are creating a Windows Forms that includes printing functionality to print an image of the form. A helper function with the following signature creates a bitmap of the current form.
private Bitmap CreateFormImageBitmap(Graphics graphic) You need to implement the PrintPage event handler to call the helper function and draw the image onto the print document.
Which code segment should you use?
A.
Grafics g = e.Graphics;
Bitmap formImageBitmap = VreateFormImageBitmap(g);
graphics.DrawImage(formImageBitmap, e.MarginBounds);
B.
Grafics g = this.CreateGraphics();
BitmapformImageBitmap = CreatFormImageBitmap(g);
g.DrawImage(formImageBitmap, ClipBound);
Dispose();
C.
Grafics g = this.CreateGraphics();
Bitmap formImageBitmap = CreatFormImageBitmap(e.Graphics);
DrawImage(formImageBitmap, g.ClipBound);
Dispose();
D.
Grafics g = this.CreateGraphics();
Bitmap formImageBitmap = CreatFormImageBitmap(g);
Graphics.DrawImage(formImageBitmap, e.MarginBounds);