ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 LoadFromURL black rectangle

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
adyble Posted - Jul 14 2025 : 04:59:16
Hello

We generate a URL to send to an image web service. The URL works fine in a browser but displays as a black rectangle using -

imageEnView1.io.loadFromUrl(TIdURI.URLEncode(strChartURL));

strChartURL is a side string of approx. 2500 characters. The issue only started when we increased the length of the URL.

imageEnView1.io.loadFromUrl(strChartURL); returns nothing.

The URL is -

https://quickchart.io/chart?bkg=%23fefafa&c={"type":"pie","data":{"datasets":[{"data":[1.86,23.6],"fill":false,"spanGaps":false,"lineTension":0.4,"pointRadius":3,"pointHoverRadius":3,"pointStyle":"circle","borderDash":[0,0],"barPercentage":0.9,"categoryPercentage":0.8,"type":"pie","label":"Dataset1","borderColor":"%234E79A7","backgroundColor":["%234E79A7","%23F28E2B"],"borderWidth":3,"hidden":false}],"labels":["170102Wood","170904MixedConstruction"]},"options":{"title":{"display":true,"position":"top","fontSize":20,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"bold","padding":10,"lineHeight":1.2,"text":"WasteBreakdown"},"layout":{"padding":{},"left":0,"right":0,"top":0,"bottom":0},"legend":{"display":true,"position":"right","align":"start","fullWidth":false,"reverse":false,"labels":{"fontSize":12,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"normal","padding":10}},"scales":{"xAxes":[{"id":"X1","display":false,"position":"bottom","type":"category","stacked":false,"offset":false,"time":{"unit":false,"stepSize":1,"displayFormats":{"millisecond":"h:mm:ss","second":"h:mm:ss","minute":"h:mm","hour":"hA","day":"MMMD","week":"ll","month":"MMMYYYY","quarter":"[Q]Q-YYYY","year":"YYYY"}},"distribution":"linear","gridLines":{"display":true,"color":"rgba(0,0,0,0.1)","borderDash":[0,0],"lineWidth":1,"drawBorder":true,"drawOnChartArea":true,"drawTicks":true,"tickMarkLength":10,"zeroLineWidth":1,"zeroLineColor":"rgba(0,0,0,0.25)","zeroLineBorderDash":[0,0]},"angleLines":{"display":true,"color":"rgba(0,0,0,0.1)","borderDash":[0,0],"lineWidth":1},"pointLabels":{"display":true,"fontColor":"%23666","fontSize":10,"fontStyle":"normal"}, "ticks":{"display":true,"fontSize":12,"fontFamily":"sans-serif","fontColor":"%23666666","fontStyle":"normal","padding":0,"stepSize":null,"minRotation":0,"maxRotation":50,"mirror":false,"reverse":false},"scaleLabel":{"display":false,"labelString":"Axislabel","lineHeight":1.2,"fontColor":"%23666666","fontFamily":"sans-serif","fontSize":12,"fontStyle":"normal","padding":4}}],"yAxes":[]},"plugins":{"datalabels":{"display":false,"align":"center","anchor": "center","backgroundColor":"%23eee","borderColor":"%23ddd","borderRadius":6,"borderWidth":1,"padding":4,"color":"%23666666","font":{"family":"sans-serif","size":10,"style":"normal"}},"datalabelsZAxis":{"enabled":false},"googleSheets":{},"airtable":{},"tickFormat":""},"cutoutPercentage":10,"rotation":-1.5707963267948966,"circumference":6.283185307179586,"startAngle":-1.5707963267948966}}
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 15 2025 : 22:45:45
You should use a different method to download to a stream or temp file, and then load from that.

Nigel
Xequte Software
www.imageen.com
xequte Posted - Jul 15 2025 : 21:21:33
Hi

No, not if you use Internet Explorer to open it (which will be using the same Windows API calls). With Internet Explorer the URL gets truncated to 2084 characters and you get the error:

Chart error: Unexpected token '%' 1:1536

You can reproduce this by running Microsoft Edge in Internet Explorer mode.


Edit: Actually, I see it is documented here:

https://support.microsoft.com/en-us/topic/maximum-url-length-is-2-083-characters-in-internet-explorer-174e7c8a-6666-f4e0-6fd6-908b53c12246


Nigel
Xequte Software
www.imageen.com
adyble Posted - Jul 15 2025 : 05:04:03
HI

The object is valid if pasted into a browser.
xequte Posted - Jul 15 2025 : 02:39:57
Sorry, I'm not sure why that is failing. We are just using Windows API calls to handle internet downloads, and this URL fails to return valid content.

Nigel
Xequte Software
www.imageen.com