Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-04-06
4
Medium Priority
?
392 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
[X]
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
  • 2
4 Comments
 
LVL 19

Expert Comment

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

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

670 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