1) save your images with the same name as the item code you want to show
the picture of
Example:
Item code ABCD1234 magnifying mirror
Image code ABCD1234.JPG
2) save all the images in a separate folder
3) put an image control in your form and call it IMAGE
4) in the AFTERROWCOLCHANGE method of the grid put this code
local cItem,pImage,cImagePath
cImagePath = 'c:\myapp\pictures\' && this is where you saved all your
pictures
cItem = alltrim(curItems.itemcode) && extract the item code from the
grid's underlying cursor
pImage = cImagePath+cItem+'.jpg' && compose the image variable with path
and name
if file ('&pImage')
with ThisForm
with .image
.visible = .t.
.picture = pImage
endwith
endwith
else
with ThisForm
with .image
.visible = .f.
.picture = ''
endwith
endwith
endif
thisform.refresh
So when you navigate the grid, if the item code has a picture associated
with it, you will see it in the image control, otherwise, you will not.
Rafael Copquin
El 15/12/2011 17:51, Gary Jeurink escribió:
> You guys have told me multiple times not to store graphics in general fields
> and have given me strategies to undo what I've got but now I need a snippet
> or procedure to call up the stored graphic. I did it a long time ago but I
> can't find the 'how to' book that showed me.
>
>
>
> I want to call up the picture in the form based on the item in a grid. Right
> now I have a container object with control source set to the photo field in
> the database. Do I just set it to the image file on the hard drive?
>
>
>
> movie database, artist database, album database, garden plant database with
> pictures and soon a . product inventory, employee, athlete team all with
> photo. So I have a lot of work in front of me not even counting the task of
> turning a few thousand of my currently stored pictures back into graphic
> images.
>
>
>
> Gary Jeurink
>
>
>
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.