Re: Image control does not display image VFP8 by Jan
Jan
Sat Oct 08 20:40:00 CDT 2005
Eric,
Thanks for the response. I am using a general field. The reason I am using
the general field is that it gives the application independance of the
location of the file, in other words it means I don't have to get the user
to place the image (company logo) in a particular place. It has worked fine
for most sites since the app was in vfp6.
At our own site we use a .mix file and that works fine even though only one
machine has MS Photodraw installed. The problem site has decided to change
logo and even though the person setting up the logo can view the image
without problem, it does not display correctly in the image control or on
the various reports. A .bmp comes out as a black rectangle, a .gif only
displays the file name (as does a .jpg) and the .mix file is unknown (no MS
photodraw on their systems at all).
As far as code is concerned, there really isn't any, all the action is in
image controls.
The benefit as I see it is that the general field stores the image as well
as the code to display the image, hence no need to have the graphics program
installed on each machine. The confusion though is why the image does not
display correctly even if it is a .bmp created in paint, on the machine that
loads the image into the general field.
I'll experiment with the binary memo field and filetostr() and strtofile().
According to the blurb, VFP since v8 hands off display of images to gdi+, so
perhaps this will deliver the same as the general field (and may prove the
general field to be the cause of the problem).
Many thanks,
Jan
"Eric den Doop" <ericdendoop@xspamblockxfoxite.com> wrote in message
news:uXo$KGDzFHA.3660@TK2MSFTNGP15.phx.gbl...
> How do you display these images? Can you show some code? Are you storing
> the image data in General Fields? It's better not to use general fields.
> Instead, use binary memo (in VFP9, use BLOB) and FILETOSTR() and
> STRTOFILE() to get data in and out of the binary memo. The problem with
> General Fields is that, in order to display data, you need the same OLE
> SERVER that was used to store the data.
> --
> Eric den Doop
> www.foxite.com - The Home Of The Visual FoxPro Experts
> Microsoft MVP for Visual FoxPro
>
> "Jan" <Nomail@Nowhere.com> wrote in message
> news:OQkqs05yFHA.2336@TK2MSFTNGP10.phx.gbl...
>> Hi All,
>>
>> We have discovered some situations where images do not display in VFP8.
>> We have tried .BMP, .GIF, .MIX and .JPG. On one system they display fine
>> yet on others you either get a black rectangle or simply see the file
>> name of the image.
>>
>> Any suggestions to solve this most welcome. All system running XP.
>>
>> TIA
>> Jan
>>
>
>