[Obsolote] Documentation Image is obsolte

Created at 14 Aug 2024, 15:44
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
prlozc's avatar

prlozc

Joined 25.12.2020

[Obsolote] Documentation Image is obsolte
14 Aug 2024, 15:44


Here (https://help.ctrader.com/ctrader-algo/references/Controls/Image/?h=image#namespace) the second example is using AccessRight which is obsolte in .net 6 and the first example Properties isn't defined

 

 

c#
using cAlgo.API;
 using System.IO;
 namespace cAlgo
 {
     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
     public class ImageSample : Indicator
     {
         [Parameter("Image File Path")]
         public string ImageFilePath { get; set; }
         protected override void Initialize()
         {
             if (!File.Exists(ImageFilePath))
             {
                 Print($"Image not found: {ImageFilePath}");
                 return;
             }
             var imageBytes = File.ReadAllBytes(ImageFilePath);
             var image = new Image
             {
                 Source = imageBytes,
                 Width = 200,
                 Height = 200,
                 HorizontalAlignment = HorizontalAlignment.Center,
                 VerticalAlignment = VerticalAlignment.Center
             };
             Chart.AddControl(image);
         }
         public override void Calculate(int index)
         {
         }
     }
 }

@prlozc