Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Stream graphic field to Image.picture
Fri, Jun 8 2007 11:39 AMPermanent Link

Chad Feldmann
If I have a graphic file in a DBISAM field I can of course set a
iwdbimage.picture to an iwimage.picture property to show the graphic in a
non-dataaware control.  Is there a way to do that without using a component
as a go between??  How do I assign that picture directly from a field
object?

I think using a Stream is the way to go, but I am having a hard time find code examples that will do this.

Thanks!

Chad
Fri, Jun 8 2007 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chad,

<< If I have a graphic file in a DBISAM field I can of course set a
iwdbimage.picture to an iwimage.picture property to show the graphic in a
non-dataaware control.  Is there a way to do that without using a component
as a go between??  How do I assign that picture directly from a field
object? >>

Just use:

MyIWImage.Picture.Graphic.Assign(TGraphicField(MyTable.FieldByName('Graphic')))

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jun 12 2007 12:24 PMPermanent Link

Chad
Tim,

The code you gave should work great.  I compiles and the program runs, but I get memory errors as soon as I try to execute it.  Frown 

I tried it with Intraweb and Windows in Delphi 2007 with DBISAM, and Delphi 6 using the BDE.  Both times I get memory errors immediately.

Perhaps I need to let CodeGear know there is a problem or is there other code that I could use as a work around?

Thank you for your assistance,

Chad



"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Chad,

<< If I have a graphic file in a DBISAM field I can of course set a
iwdbimage.picture to an iwimage.picture property to show the graphic in a
non-dataaware control.  Is there a way to do that without using a component
as a go between??  How do I assign that picture directly from a field
object? >>

Just use:

MyIWImage.Picture.Graphic.Assign(TGraphicField(MyTable.FieldByName('Graphic')))

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Jun 12 2007 4:41 PMPermanent Link

"Mike Shkolnik"
> The code you gave should work great.  I compiles and the program runs, but
I get memory
> errors as soon as I try to execute it.  Frown
Are you sure your field ('Graphic' in Tim's code) is TGraphicField?

--
With best regards, Mike Shkolnik
Scalabium Software
http://www.scalabium.com
mshkolnik@scalabium.com

Tue, Jun 12 2007 6:28 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Mike,

<< Are you sure your field ('Graphic' in Tim's code) is TGraphicField? >>

Good point.  I probably should have just used this instead:

MyIWImage.Picture.Graphic.Assign(TBlobField(MyTable.FieldByName('Graphic')))

It should work just as well, and not need a TGraphicField.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image