Hello,
I am developing an indicator with CustomDrawing; I have MouseEvents(true) and I enter into this function when I click the mouse:
protected override void OnMouseEvent(MouseClickArgs arg)
{
//here after having clicked
}
inside OnMouseEvent(MouseClickArgs arg) I would like to draw a rectangle using a code like this:
Pen p1=new Pen(Color.Yellow,1);
PointF b1,b2;
b1 = GetPointFromBar(context, Bars.Time[0],Bars.Close[0]);
context.graphics.DrawRectangle(p1,b1.X,b1.Y,100,100);
How to retrieve context inside OnMouseEvent?
Tx
How to draw inside OnMouseEvent [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to draw inside OnMouseEvent [SOLVED]
Hello gbulle,
You can save the coordinates and put a flag. Then while drawing if there is a flag then draw using the saved coordinates.
You can save the coordinates and put a flag. Then while drawing if there is a flag then draw using the saved coordinates.