graphics.DrawImage(...,...);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Add mouse-over and click functionality? Handling windows events in indicator?
Collapse
X
-
Treat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.Originally posted by adamus View PostI hadn't coded the image yet. I assume something like
in the Plot() would be enough, assuming I figure out where on the filesystem to load the jpg from.Code:graphics.DrawImage(...,...);
Comment
-
But I don't get a reference to them when I call the graphics object, and it doesnt seem that I can declare and initialize anything helpful either for the graphics calls either. At least nothing that CustomPlotSample.cs demonstrates.Originally posted by koganam View PostTreat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.
AFAIK now I need a control or a sub-class of a control, because that is the only thing I can use to attach events to, but I dont have anything except the ChartControl.
(The same theory applies to creating tooltips which you suggested earlier, it seems)
Correct me if I'm wrong, please, but I'm sitting on lame duck here.
In case there is an obvious solution that I am missing, could you state it in terms of
rather than graphics.DrawImage() which I have abandoned to avoid requiring a file.Code:graphics.FillEllipse(brush, rectangle);
[EDIT] Now that I'm thinking a bit more clearly thanks to some well-timed caffeine, I figured it would be simple to place a control on the chart instead of drawing an image or a circle, and then I won't have any problem attaching the tooltip / label pop-up.
The question is, would a tiny button be OK in case I have to show 100 of these things on the chart in one plot?
(Is this still sane? It comes from about 4 hours of googling)Last edited by adamus; 07-24-2013, 07:57 AM.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment