• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 167
  • Last Modified:

i have problem how pass i to field(image) to an image?

i have problem how pass i to field(image) to an image?
i have these code:
table1.fieldbyname('foto').assign(image1.picture.graphic)
i need invert the process
something image1.picture.graphic:=table1.fieldbyname('foto').value
somebody can help me?
how is the form correct?
0
jamiguel
Asked:
jamiguel
  • 3
  • 2
1 Solution
 
jamiguelAuthor Commented:
Edited text of question
0
 
heathprovostCommented:
This should do it

Image1.Picture.Assign(Table1.FieldByName('foto').Value);
0
 
heathprovostCommented:
Correction

Image1.Picture.Graphic.Assign(Table1.FieldByName('foto').Value);

but you really dont need to use the graphic property, you can just use the picture property. for example

Table1.FieldByName('foto').Assign(Image1.Picture);
and vise versus
0
 
jamiguelAuthor Commented:
i write these code:

image1.picture.assign(table1.fieldbyname('Foto').value);
and
image1.picture.graphic.assign(table1.fieldbyname('Foto').value);

but in both cases mark these error:  (at time of run or compile)
"incompatible types 'Tpersistent' and 'Variant' "

0
 
heathprovostCommented:
Sorry about that, I wasnt thinking the correct answer is

Image1.Picture.Assign(TBlobField(Table1.FieldByName('Foto')));

This WILL work, I tested.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now