Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:14:30+00:00 2026-06-04T04:14:30+00:00

I have a jpeg file saved in a string. I would like to load/assign

  • 0

I have a jpeg file saved in a string. I would like to load/assign the string to a TImage in Delphi7. I use KOL for the following Code:

var
 ImageStream : PStream;
 ImageString : String;
 MyJpeg      : TJpeg;
begin
 ImageStream:= NewMemoryStream; // Create New Stream.
 ImageStream.Write(ImageString [1], Length(ImageString )); // Fill the stream.
 ImageStream.Position := 0;     // Set Position to 0.
 // ImageStream.SaveToFile('C:\test.jpg', 0, ImageStream.Size); // Debug --> WORKS!
 MyJpeg := TJpegImage.Create; // Create a Jpeg Image. 
 MyJpeg.LoadFromStream(@ImageStream); // ???
 Image1.picture.Assign(MyJpeg);       // No picture is shown
end;

It should work since PStream is just a pointer to TStream…
But there is no picture shown in Timage…
Thanks for your help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:14:31+00:00Added an answer on June 4, 2026 at 4:14 am

    You state that

    PStream is just a pointer to TStream

    In which case this code

    MyJpeg.LoadFromStream(@ImageStream);
    

    cannot work. You are passing, to a parameter of type TStream, a pointer to a pointer to TStream. To make your code compile you need to pass a TStream to LoadFromStream. Like this:

    MyJpeg.LoadFromStream(ImageStream^);
    

    In your position, I would probably use a TStringStream like this.

    var
      Stream: TStringStream;
    ....
    Stream := TStringStream.Create(ImageString);
    try
      MyJpeg := TJpegImage.Create;
      try
        MyJpeg.LoadFromStream(Stream);
        Image1.Picture.Assign(MyJpeg);
      finally
        MyJpeg.Free;
      end;
    finally
      Stream.Free;
    end;
    

    Perhaps there is a KOL way to do that, I don’t know KOL at all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In asp.net, we have uploaded a .jpeg file and saved this as bitmap image
I have the following code which takes an improperly saved Image from the database
I have used the following code to create a file in a temp location
I have merged multiple jpeg files into one single .bin file. ..... ......... while(true){
How can i compress and image file(*bmp,*jpeg) in C#, I have to display some
I have a 2MB JPEG image, and when I use the option Image >
I have a Base64 jpeg image string which is a simple signature image. I
i have this issue working but i would like to know if there is
I have tried working with a bit of code to decode a file from
I have a code to downolad a particular file that is stored at a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.