You are not actually reusing the bitmap. In second form, you create another bitmap from file. So, all your question about collaboration between forms is totally pointless, the problem is not explained. The code looks like something unacceptable. You hard-code the image size and other figures, use the hard-coded values twice, which makes the code unsupportable. Drawing in an image for showing the image on the form is pointless. If this is what you need, you just need to use
Graphics.DrawImage
on some control (even on the form itself) in the handler of the event
Control.Paint
or overridden method
Control.OnPaint
.
If that's all you need, you also don't need this redundant control
PictureBox
. (Sorry if this advice is redundant; this is because I don't know where do you use it and how, so, consider this advice as as "just in case" one.) Please see my past answers:
Append a picture within picturebox[
^],
draw a rectangle in C#[
^],
How do I clear a panel from old drawing[
^].
For more information on graphics and image rendering, please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^],
capture the drawing on a panel[
^],
Drawing Lines between mdi child forms[
^].
On form collaboration issues, please see my article:
Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows[
^].
—SA