Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to retrieve and display a TJPEGImage from a Paradox blob field Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
28-Aug-02
Category
DB-General
Language
Delphi 3.x
Views
125
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to retrieve and display a TJPEGImage from a Paradox blob field

Answer:

Solve 1:

Here's some code to fill a TImage on a form with a JPEGImage from a Paradox blob 
field:

1   var
2     Stream1: TBlobStream;
3     Photo: TJPEGImage;
4   begin
5     Stream1 := TBlobStream.Create(Table1.FieldByName('YourFieldName') as TBlobField, 
6   bmRead);
7     Photo := TJPEGImage.create;
8     try
9       Photo.LoadFromStream(Stream1);
10      Image1.Picture.Assign(Photo);
11    finally
12      Stream1.Free;
13      Photo.Free;
14    end;
15  end;



Solve 2:

Here is an example showing use of the TJPEGImage to display JPEG images in a TImage 
component. The JPEG data is stored in a Paradox BLOB field, and this routine is 
executed when the record pointer is moved in the table in order to display each new 
record's BLOB field contents.

16  procedure TForm1.Table1AfterScroll(DataSet: TDataSet);
17  var
18    MS: TMemoryStream;
19    J1: TJPEGImage;
20  begin
21    J1 := TJPEGImage.Create;
22    MS := TMemoryStream.Create;
23    try
24      TBlobField(DataSet.Fields[1]).SaveToStream(MS);
25      MS.Seek(soFromBeginning, 0);
26      with J1 do
27      begin
28        PixelFormat := jf24Bit;
29        Scale := jsFullSize;
30        Grayscale := False;
31        Performance := jpBestQuality;
32        ProgressiveDisplay := True;
33        ProgressiveEncoding := True;
34        LoadFromStream(MS);
35      end;
36      Image1.Picture.Graphic.Assign(J1);
37    finally
38      J1.Free;
39      MS.Free;
40    end;
41  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC