Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I store image data in PictureVal
Message
From
10/10/2005 00:31:52
 
 
To
08/10/2005 04:11:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01057389
Message ID:
01057593
Views:
22
Hi Cetin
Thanks for your reply. The reason I was asking about this is :

You can use the PictureVal property of an Image object to hold the actual image data. This means you don’t have to refer to a disk file to display the image(Craig Berntson)

Craig states "...you don’t have to refer to a disk file ..."

That is what I am curious about. Disk files, Blob fields etc all require that the file is read from disk at runtime. This is not what he says. Even a Blob field is data that will be stored somewhere.

What I am trying to achieve is to display the bitmap using the PictureVal property WITHOUT" going to the disk at runtime.

How do I do that?

I have a feeling that there are some issues with the property being truncated at CHR(0) or some such problem.


>>Hi Guys
>>
>>Has anyone successfully used the PictureVal property of an Image control to display an image?
>>
>>I read recently in Craig Berntson's blog -
>>
>>http://www.craigberntson.com/archives/2004_09_01_archive.asp
>>
>>the following :
>>
>>You can use the PictureVal property of an Image object to hold the actual image data. This means you don’t have to refer to a disk file to display the image.
>>
>>I have tried but no picture shows at runtime. I used the following PRG to allow me to select a picture which is then stored in the PictureVal property of an image object on a form.
>>
>>
>>* getpicture.prg
>>**********************
>>ON KEY LABEL CTRL+P do getpix in c:\vfp9\getpicture.prg
>>RETURN
>>**********************
>>FUNCTION getpix
>>LOCAL bb,cStr,cFile
>>bb = SYS(1270)
>>IF bb.baseclass=´Image´
>>cFIle = GETFILE("BMP,JPG,GIF","Select Picture")
>>IF EMPTY(cFile)
>> RETURN
>>ENDIF
>>cStr=FILETOSTR(cFile)
>>bb.Pictureval=cStr
>>ENDIF
>>
>>
>>I Select the Image object and then in the property sheet I select the PictureVal Property and place my cursor on this property.
>>
>>I then hover my mouse over the image and press Ctrl+P. I then select a BMP - in my case fox.bmp in the VFP main directory. The picture shows up in the image object on the form and the property has some chrs in it.
>>
>>However on running the form the picture is NOT displayed and the does not appear after that till I repeat the Ctrl+P stuff.
>>
>>So how do you store the image in this property and display it without going to disk for it?
>>
>>What is Craig talking about when he says that "you don’t have to refer to a disk file to display the image."
>
>Bernard,
>I think it's not a good way to use for disk based files (meaning file is already on disk-not stored in a memo or blob field).
>If you'd use it with disk based files use Picture property instead. PictureVal uses twice the memory needed to render it when used with file references.
>If you store your pictures in BLOB field then you should go with PictureVal.
>
oForm.myImage.PictureVal = myTable.myBLOBfield
>If you store file name and path in a field (or get file path at run time as you did with getfile() or getpict()) or would directly store to a property then use Picture property:
>
oForm.myImage.Picture = m.cFile
>
oForm.myImage.Picture = myTable.myImageNameAndPath
>or as Property in PEM sheet:
>Picture: c:\my Path\myImageFile.jpg
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform