Solved

Assistance with code needed

Posted on 2007-11-27
4
140 Views
Last Modified: 2010-04-05
Hi Expert,

I am trying to stream some data from the net.

Could someone have a look at this code and tell me where I'm going wrong in creating the stream please?

Data : TMemoryStream; //The Stream
DataString : String;

Data := TMemoryStream.Create;


DataString :=('http://www.AWebsite.co.uk/Ceiling.jpg');

CeilingTex := DJXTextureList1.CreateTextureFromStream(Data,'ceiling');

Thanks

ST3VO
0
Comment
Question by:ST3VO
  • 2
  • 2
4 Comments
 
LVL 10

Expert Comment

by:dinilud
Comment Utility
Try Like this


Data : TMemoryStream; //The Stream
DataString : String;

Data := TMemoryStream.Create;

Data.LoadFromFile(FileName);
Data.position:=0;


DataString :=('http://www.AWebsite.co.uk/Ceiling.jpg');

CeilingTex := DJXTextureList1.CreateTextureFromStream(Data,'ceiling');
0
 

Author Comment

by:ST3VO
Comment Utility
Nope still not streaming from URL
0
 
LVL 10

Accepted Solution

by:
dinilud earned 500 total points
Comment Utility

URLDownload1.OpenRequestEx('http://www.AWebsite.co.uk/Ceiling.jpg', nil, Pointer(liItem.Index));


.......................

procedure TForm1.UrlDownload1UrlComplete(Sender: TObject; ID, TotalMilliseconds: Cardinal; Stream: TStream);
var  liItem:        TListItem;
     f:String;
begin

  CeilingTex := DJXTextureList1.CreateTextureFromStream(Stream,'ceiling');
 

end;
0
 

Author Comment

by:ST3VO
Comment Utility
I'll give it a try in a bit and let you know!

Looks interesting :o)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video discusses moving either the default database or any database to a new volume.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now