Board index » delphi » TDBImage - Saving to a blob field in interbase

TDBImage - Saving to a blob field in interbase

Greetings All,

I would like to use a TDBImage component that would allow the user to right
click on the component to display a popupmenu with the options to:

1) load a bitmap using a TOpenDialog component and save it to interbase blob
field.

2) clear the image.

Obviously if the blob field contains a bitmap I need it to display in the
TDBImage component.

Does anyone have some code to help me do this.

Thanks for any help.

Mike

 

Re:TDBImage - Saving to a blob field in interbase


Hi,

ST Wizard <stwiz...@networksplus.net> wrote in article
<7lu9a6$di...@forums.borland.com>...

Quote
> Greetings All,

> I would like to use a TDBImage component that would allow the user to
right
> click on the component to display a popupmenu with the options to:

> 1) load a bitmap using a TOpenDialog component and save it to interbase
blob
> field.

        MyTable.edit;
        If OpenDialog1.Execute then
                MyTablesBlobField.loadFromFile(OpenDialog1.filename);
        MyTable.post;

Quote

> 2) clear the image.

        You'd be better off emptying the field, then refreshing the component:
                MyTable.edit;
                MyTablesBlobfield.clear;
                MyTable.post;
Quote

> Obviously if the blob field contains a bitmap I need it to display in the
> TDBImage component.

> Does anyone have some code to help me do this.

> Thanks for any help.

> Mike

Re:TDBImage - Saving to a blob field in interbase


Hi, ST Wizard.

You can look on http://www.interbase.com and find article to BMP in IB. Too
that good article have on http://www.mers.com.

Regard.

ps. I'm sorry for my very bad English.
--
Petio Tonev
pto...@iname.com
www.i.am/ptonev , www.w3.to/tonevsoft

Re:TDBImage - Saving to a blob field in interbase


On Tue, 6 Jul 1999 20:12:43 -0500, "ST Wizard" <stwiz...@networksplus.net>
wrote:

Quote
>I would like to use a TDBImage component that would allow the user to right
>click on the component to display a popupmenu with the options to:

>1) load a bitmap using a TOpenDialog component and save it to interbase blob
>field.

The TOpenDialog.FileName property returns the name and location of the file
to open. This value can be used as the parameter for the
TBlobField.LoadFromFile method.

  if OpenDialog1.Execute then
    TBlobField(Query1.Fields[44]).LoadFromFile(OpenDialog1.FileName);

Quote
>2) clear the image.

If the dataset component is in edit mode, the TField.Clear method will
empty the field of all contents. If a data-aware control should happen to
be connected to the field, it should reflect the change to nothing.

==========================================================================
Steve Koterski                  "Computers are useless. They can only give
Technical Publications          you answers."
Borland                                       -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi

Other Threads