C
Christina Androne
Hi
I want to allow the user to drow some locators on an image and connect
the locators with lines. So I tried to put the following code in the
onmousedown enevt of the picture:
Graphics LGraphics = Graphics.FromImage(imgMap.Image);
LGraphics.DrawString("X", new Font("Arial", 12),
SystemBrushes.WindowText, AX, AY);
Pen LPen = new Pen(System.Drawing.Color.Black);
LPen.Brush = SystemBrushes.WindowText;
if ((FLastX >= 0) && (FLastY >= 0))
{
LGraphics.DrawLine(LPen, FLastX, FLastY, AX, AY);
}
LGraphics.Save();
FLastX = AX;
FLastY = AY;
The really annoying thing is
1) I can't use this code for indexed bitmaps
2) Nothing appears on the image
My questions are:
1) How do I set the color for the text to be shown ("X" in my case)?
2) How should I draw on all types of bitmaps?
and of course
3) What to do so my text and my lines become visible on the bitmap?
Note: imgMap.Image is of type System.Drawing.Image and loaded with a
bitmap.
Thanks in advance for any help !
Christina Androne
I want to allow the user to drow some locators on an image and connect
the locators with lines. So I tried to put the following code in the
onmousedown enevt of the picture:
Graphics LGraphics = Graphics.FromImage(imgMap.Image);
LGraphics.DrawString("X", new Font("Arial", 12),
SystemBrushes.WindowText, AX, AY);
Pen LPen = new Pen(System.Drawing.Color.Black);
LPen.Brush = SystemBrushes.WindowText;
if ((FLastX >= 0) && (FLastY >= 0))
{
LGraphics.DrawLine(LPen, FLastX, FLastY, AX, AY);
}
LGraphics.Save();
FLastX = AX;
FLastY = AY;
The really annoying thing is
1) I can't use this code for indexed bitmaps
2) Nothing appears on the image
My questions are:
1) How do I set the color for the text to be shown ("X" in my case)?
2) How should I draw on all types of bitmaps?
and of course
3) What to do so my text and my lines become visible on the bitmap?
Note: imgMap.Image is of type System.Drawing.Image and loaded with a
bitmap.
Thanks in advance for any help !
Christina Androne