Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > how to display a jpeg image from blob field in tdbimage...
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 14th July 05:51
markcr
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


I realise that this has been asked a few times in various ways, including by
me, but how can i display a jpeg image stored in a blob filed in a tdbimage
component? I am using paradox table and c++builder 6

Can the TDBImage be changed to have functions which display a jpeg image (it
errors with an invalid nitmap image currently)

Most example I have googled use Delphi code, which is no use for me.
  Reply With Quote


  sponsored links


2 14th July 05:52
antonio felix
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


"Markcr" <markcr@ntlworldminusthistext.com> escreveu na mensagem
news:44a92428$1@newsgroups.borland.com...


Hi,

Just include the JPeg.hpp Header file
( at least with BCB5 - Presumed it stills the same )

HTH
Antonio
  Reply With Quote
3 14th July 05:52
markcr
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


It is already included. I can load a jpeg into a TImage but not a TDBImage
  Reply With Quote
4 14th July 05:52
antonio felix
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


Take a look at

http://groups.google.pt/group/borland.public.cppbuilder.database.sqlservers/browse_frm/thread/c6e5f1fe144c7bb9/b40d8eac389a4125?lnk=st&q=builder+jpeg+tdbimage&rnum=6&hl=pt-PT#b40d8eac389a4125

HTH
Antonio
  Reply With Quote
5 14th July 05:52
markcr
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


OK, I put the code in the form create, but I still get Bitmap image is not
valid when I open the database.
Should the code live somehwere else?
  Reply With Quote
6 14th July 05:52
antonio felix
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


Don't use the Form Create, use it in the form constructor.
Are you shure that you have a valid jpeg in the Blob field?

Br
Antonio
  Reply With Quote
7 14th July 05:52
markcr
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


I am sure. If i savetofile and then loadfromfile in a TImage I have no
problems, but I want to cut out the savetofileand loadfromfile section,
  Reply With Quote
8 14th July 05:52
mark richards
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


Does anyone have a wroking code that can access a TBlobField, save it to a
memory stream, and then load it into a TImage?

--
---------------------------------------
And a pointless sig...
---------------------------------------
There are 10 types of people in the world
those that understand binary and those that don't
  Reply With Quote
9 14th July 05:52
antonio felix
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


if ( !Dm->IBSU->FieldByName("PGraph")->IsNull ) {
TJPEGImage *Jp;
TMemoryStream *Blob;
try {
Jp = new TJPEGImage();
Blob = new TMemoryStream();
Dm->IBSU->FieldByName("PGraph")->SaveToStream( Blob );
Blob->Position = 0;
Jp->LoadFromStream( Blob );
IPGraph->Picture->Bitmap->Assign( Jp );
delete Blob;
delete Jp;
}
catch( Exception &E ) {
FxMsgE( Application->Handle, "Imagem:", "Cannot Load Image.", E );
delete Blob;
delete Jp;
} } else
IPGraph->Picture->Metafile->Clear(); ... IPGraph = TImage
Dm->IBSU = TIBSQL on a DataModule ( change it by your Dataset )

HTH
Antonio
  Reply With Quote
10 14th July 05:52
markcr
External User
 
Posts: 1
Default how to display a jpeg image from blob field in tdbimage...


thanks, I will implement that later. Ditched the dbimage control, so that
should work better, at least it cuts out opening files.
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666