Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to display JPG in a form
Message
De
10/01/2000 18:37:48
Ian Matthews
Up & Running Technologies Inc
Chestermere, Alberta, Canada
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00276185
Message ID:
00315846
Vues:
36
Once again, thanx for the detail... it realy does help:

I am not married to the General Field process, I could use something else. You indicated that you use an Image object; that would fix the 'diplay on form' issue I am having but I don't know how to point it get the image from a field in the database. I therefore have 2 questions:
1: How would one embed a JPG in a table without using a General Field?
2: How would one point the Image object to that field?

Thanx in advance.

>Ian,
>
>I've never used a general field for anything more that toying with a Word doc way back in FPW2.x. When I found out how basically useless (IMHO) they are I stopped using them. STRTOFILE() is complaining because the general/memo field isn't a string as far as it's concerned. You can coerce a memo to string by doing lcString = TheTable.TheMemo + "" I don't know if that's going to work for the general field or not. Even if it does create a file I don't think you will have a pure .jpg, I think the general field stores additional OLE information about what kind of object it is. If that's the case you may be forced into running a scan loop over the table doing a MODIFY GENERAL to launch another JPG viewer app (could be IE, Paint? PaintShopPro, MS Photo Editor whatever current jpg assigned program you have) and do a SaveAs from inside there. If you have too many of these to do by hand you could maybe get one strtofile() and the same file stored out as a real jpg and look to see
>the differences using the hexedit.app, you could then programatically peel off the OLE junk. JPGs have an easily findable signature at the start of the file. There are 6 hex bytes and then the characters JFIF at the start.
>
>I guess the OLE bound control doesn't understand JPG. I've never used it, the Image object understand jpg and that's the control I use since I don't do general fields.
>
>>Hi Ho... I need just a little more info/clarification if you can spare the time:
>>
>>I finally forced the time to look at this issue again and I think your solution should work nicely but I can not get STRTOFILE() to function. Here is what is happening:
>>
>>strtofile(orders.invoicescan, "c:\tempimg.jpg")
>>
>>where INVOICESCAN is a General Field containing a JPG
>>
>>I get "INVALID ARGUMENT VALUE, TYPE OR COUNT IS INVALID."
>>
>>I can get this command to work if I am using text fields with text data but not the GENERAL FIELD. I have checked MSDN CD's and Tech Net but nothing useful came of it. Any idea's why I can not push a JPG in a General field to a file???
>>
>>Another (directly related) annoying issue is that if I use a OLEBOUNDCONTROL on the same field, the graphic IS displayed if it is a BMP but not if it is a JGP. Any idea's why this is??????????
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform