Can't add some images as resources and post them to CTDN

Created at 01 Feb 2021, 21:00
algocorner's avatar

algocorner

Joined 29.01.2021

Can't add some images as resources and post them to CTDN
01 Feb 2021, 21:00


Hello Panagiotis,

I'm posting this issue I had with ctdn while posting a code with an image resource, apparently, it says:

I have solved it by uploading an image file much smaller, from 1800px wide to about 400px wide, this is a solution for me, but maybe you need to check this issue, here's the code:

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using cAlgo.Properties;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleAddImageAsResource : Indicator
    {
        protected override void Initialize()
        {
            var image1 = new Image
            {
                Source = Resources.logo_white_background_resized_to_1800px,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
            };

            Chart.AddControl(image1);
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}

The image has the following properties



Regards,

Xavier


@algocorner
Replies

PanagiotisCharalampous
02 Feb 2021, 08:47 ( Updated at: 19 Mar 2025, 08:57 )

Hi Xavier,

Can you send me the actual .algo file to support@ctrader.com so that I can check?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

algocorner
05 Feb 2021, 19:31 ( Updated at: 19 Mar 2025, 08:57 )

RE:

Hello Panagiotis,

I have sent it a couple of days ago, thank you

PanagiotisCharalampous said:

Hi Xavier,

Can you send me the actual .algo file to support@ctrader.com so that I can check?

Best Regards,

Panagiotis 

Join us on Telegram

 


@algocorner