Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
NT8 SuperDom column - cache rectangles to bitmapimage
Collapse
X
-
NT8 SuperDom column - cache rectangles to bitmapimage
I am developing a superdom column that draws thousands of rectangles, but this approach is too slow. Instead of drawing each rectangle to the columns drawingcontext individually in OnRender, how can I create a bitmap outside of on render, paint the necessary rectangles, save the bitmap, and draw the bitmap once in OnRender? I know this is possible using the DirectX controls that charts/indicators use, but I'm confused how to implement this using WPF in a superdom column. Any help would be greatly appreciated!
ThanksTags: None
-
Hi, thanks for posting.
We have an example of rendering a bitmap using SharpDX (attached). I do not know of an existing NinjaScript example of generating a bitmap at run time, but Microsoft has a page on the subject:
https://docs.microsoft.com/en-us/dot...orkdesktop-4.8 (publicly available)
Best regards,
-ChrisL
Attached Files
-
Hi Chris,
This partially addresses my issue, but I need this functionality in a SuperDom column (that uses WPF), NOT an Indicator (that uses DirectX). This is the aspect that I am unable to solve on my own.
Thanks again
Comment
-
The SuperDom column OnRender override is "OnRender(DrawingContext dc, double renderWidth)"
The Indicator OnRender override is "OnRender(ChartControl chartControl, ChartScale chartScale)"
My issue is using the superdom column DrawingContext dc "dc.DrawImage(ImageSource, Rect)"...converting a SharpDX.Direct2D1.Bitmap to an ImageSource that I can render in the SuperDom column. Does this make sense? Both namespaces use different rendering engines, and my understanding of both is not complete. I see that I am able to instantiate and modify SharpDX objects in the superdom column with WPF, but this is of no use if I can't convert them to ImageSource objects for dc.DrawImage()
Thanks
Comment
-
Hi, I looked into converting a System.Drawing.Bitmap to an ImageSource and found this page:
https://stackoverflow.com/questions/...to-imagesource (publicly available)
I do not have any examples written from within our library for generating this image, that would need to be researched further. As far as the OnRender method from the DOM column, this only needs to render the ImageSource using code similar to the example in the DrawingContext page.
Kind regards,
-ChrisL
Comment
-
Do you guys have any sample code for actually loading and displaying an image in a SuperDOM column? This would be the most helpful
Thanks
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment