You could simply impose a
Label
instance on top of the
PictureBox
control, using absolute positioning (
Label::Top
,
Label::Left
). However, this won't give you transparent label background (transparency is a general problem of
System.Windows.Forms
, unlike WPF).
You can also draw on the image itself. The algorithm is this:
I should also note that this is too much for
PictureBox
— this class does not help you, just presents some extra hassles, eats up some extra resource and your development time, nothing else. You should better draw immediately on some control, using the event
Paint
or overriding the virtual method
OnPaint
. Please see my past answers:
How do I clear a panel from old drawing[
^],
draw a rectangle in C#[
^],
Append a picture within picturebox[
^];
and also:
Drawing Lines between mdi child forms[
^],
capture the drawing on a panel[
^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[
^].
—SA