Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to load a blobfield from a firebird table into an image

Posted on 2014-04-06
4
385 Views
Last Modified: 2014-04-12
Hi, can anyone help me how to load the value of a blobfield into an image ?

thx
Mario
0
Comment
Question by:marioway
  • 2
4 Comments
 
LVL 19

Expert Comment

by:NickUpson
ID: 39981736
you might do better asking in the interbase/firebird database area.
0
 
LVL 42

Expert Comment

by:pcelba
ID: 39981831
Also if the code should be in Delphi then I would recommend Delphi zone...

OTOH, you could use FoxPro because the code is then very simple:
lnHandle = SQLCONNECT()
IF lnHandle > 0
  lnResult = SQLEXEC(lnHandle, "SELECT YourBlobField FROM YourTable WHERE SomeCondition", "cOutput")
  IF lnResult > 0
    *-- Save blob from the first record to image file
    SELECT cOutput
    GO TOP
    COPY MEMO YourBlobField TO d:\path\imagefile.ext
  ELSE
    *-- Process error
  ENDIF
  = SQLDISCONNECT(lnHandle)
ENDIF

Open in new window

0
 

Accepted Solution

by:
marioway earned 0 total points
ID: 39982787
Hi guys, I found my own solution , works fine for me

procedure TIkoonfact.DBGrid1DblClick(Sender: TObject);
var Blobstream: TMemorystream;
    Bitmap: TBitmap;
    Field: TBlobField;
begin
 with Datamodule1 do begin
     //inladen opgeslagen beeld
  try
   Blobstream := TMemoryStream.Create;
   Bitmap := TBitmap.Create;
   Field := TBlobField(Foto1query.FieldByName('FOTOKES'));
   Field.SaveToStream(Blobstream);
   Blobstream.Position := 0;
   Bitmap.LoadFromStream(Blobstream);
   Image2.Picture.Assign(Bitmap);
  finally
   Blobstream.Free;
   Bitmap.Free;
  end;
 end;
end;

Open in new window

0
 

Author Closing Comment

by:marioway
ID: 39995871
I did not get a solution to my question.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL BACKUP - 2008 R2 8 71
Working with SharePoint Data 8 62
Process mapping 5 62
What does it take to create an installation.exe windows based. 2 40
I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

828 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