Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP 7.0 Can you put a picture/log in any field type

Status
Not open for further replies.

bettyfurr

Technical User
Mar 12, 2002
371
US
The users want a logo in a field. Any way to do this?

Betty
 
Hi Betty,

Be more specific!

What do you want?
Show a picture in a grid column?
Or store a picture file (logo) in a table field?
Or show a logo in a report?
Or what?

Bye, Olaf.
 
Sorry for not being clear, Olaf.

A user fills out information and different individuals approve the information. There is an existing "approved by" text field.

They want to enter a "store a picture file (logo) in a table field?" So later when they print the report the "show a logo in a report?" in the "approved by" field.

Different divisions have their own Symbols and it would be impossible to add a list to the code for printing.

Thank you,

Betty ;-)
 

If you are using VFP9.0 use a bolb field to store the pictures in a binary format.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 

Sorry I meant BLOB. And to answer your question, no you cannot put a picture in any field type. GENERAL, BLOB or binary memo fields can hold picture in their respective manner.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
GENERAL, BLOB or binary memo fields can hold picture in their respective manner

These fields are not in VFP 7?

Betty :-(
 
So is binary memo


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi betty,

Mike: Of course you cannot store a picture in eg an integer field. Far too small to store a picture file or even just a path to a picture file. I'd say betty meant something else with that question.

A binary memo field is either defined in the table designer (you'll find it there as "Memo (binary)" or in code like this:

create table ...( mBinary M NOCPTRANS)

Be warned: With a General Field you are getting problems reading out the picture after it's stored in the field. A general field is bloated with information about the application that can show the object and a thumbnail BMP is also stored. That makes it bigger and if the application dedicated to the file extension changes the general field content can become useless.

The advantage is, a General field may be easier to display on a report, without first copying the content of a binary memo field to a picture file, as you can't simply display a memo field on an Image control.

Bye, Olaf.
 
I will try you guys suggestions. Let you know with stars.

Thanks!


Betty

:)
 
From the forms tool bar, I do not see a general field. I am using VFP 7.0 and know you guys are right. There is one.

It is my in ability to follow very good directions.

Please help.

Betty :-(
 
Hi Betty,

it's not a type of control in the controls toolbar, it's a field type for a table.

In the dropdown combobox of the table designer it's called "Object".

With code, you define a general field with
Create Cursor curTest (oPic G)

When you browse that cursor and click on the "obj", you can eg Paste a screenshot made with the [PRINT] key to the field with [CTRL]+[V].

On a form, place an "OleBoundControl", set it's controlsource to curTest.oPic and you'll see the pic on the form. The same goes for reports.

But I warned you about the size such a field uses and other disadvantages...

Bye, Olaf.
 
I designed a test table with a general field. I could not get the field to accept a paste. Do you have to create a cursor for that field be active? Did I have to create instead an Object field?

That sounds difficult for a user wanting to put in their logo into the field from an input screen.

Do you think this is a feasible?

Betty
 

Betty

Code:
CREATE TABLE MyGenTbl (mygenfield G)
APPEND BLANK  && Add a blank record
APPEND GENERAL mygenfield FROM C:\mypic.jpg



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hi Betty,

you first need a record to paste something to it, so therefore APPEND BLANK.

In a browse window the general field displays "obj" for an empty field and "Obj" for a field containing something. Almost like "memo" and "Memo" for memo fields.

Then you can use APPEND GENERAL, as Mike showed. Let your user choose a picture with GETPICT() and then use the file name you get from it with an APPEND GENERAL command...

Bye,Olaf.
 
Will try this tonight and get back with you.

thank you all for your help.

betty

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top