HTTPGET an image

new BookmarkLockedFalling
metro
Full Member
***

metro Avatar

Posts: 207

Post by metro on Sept 6, 2015 0:39:51 GMT -5

Back for some help,
I have a Liberty Basic program that displays charts from Yahoo finance via the Yahoo API
httpget works fine in LB, I can display the downloaded image in a graphic box with no issues.

I don't understand why the "png" image will not display in RB using the same code

how ever the file downloaded using LB4.50 will render when opened within RB

I have concluded the RB "saved" file gets corrupted some how

any help appreciated
urlfile$ = "http://chart.finance.yahoo.com/z?s=NAB.AX&t=1y&q=l&l=on&z=l&p=m10,m50,v&a=r14"
page$=HTTPGET$(urlfile$)


open "pic.png" for output as #1
print #1, page$
close #1


loadgraphic #picture, "pic.png"
render #picture


SOLVED: opened the file for binary did the trick
:(
lot to learn
Last Edit: Sept 6, 2015 3:54:33 GMT -5 by metro: Solved
Intel Core2 QUAD CPU @2.54 x 4 Mint Linux 19.3 Mate
StefanPendl
Global Moderator
*****

StefanPendl Avatar

Run for BASIC ...
Posts: 945

[b]Stefan[/b] - [a href=http://stefanpendl.runbasichosting.com/]Homepage[/a][br][br][b]Please give credit if you use code I post, no need to ask for permission.[/b][br][br]Run BASIC 1.01, Fire-/Waterfox (IE11, Edge), Windows 10 Professional x64, Intel Core i7-4710MQ 2.5GHz, 16GB RAM