Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
What is the code for displaying picture in Visual Foxpro 6?
Does anyone know the codes for displaying a picture that is found within a Column in a table using Visual Foxpro 6?
My project was Library System, that includes the time in and time out of the librarians and students. And needs to upload a picture of students together of their information in the registration.
Example:
If a student enters the Library , he/she needs to swipe his/her ID to login or time in and his/her information will appear on the computer of the admin. Same process when he/she leaves the library . . . he/she needs to swipe his/her ID then logout / time out.
I think your question is vague and misleading based on other answer provided. What is SOUNDS like is that you have a database of teachers and students (much like a membership as a gym or similar). For each record in the database, you have an image file associated with that person. The image may be part of the actual table, or just a file name that is pointing to a specific directory on your drive share, where all the people images are available.
From that, these people have ID cards and when they enter a given facility (your Library for example), they run their ID card through a reader. At that time you are doing a search from your network database of users, find the user and pull up the image to the screen to show who the person is to help prevent fraud of someone using somebody else's ID card. This allows the person monitoring the entry area to make sure that Jim is not using "Bill's ID card to gain access.
If this is the case, and your VFP app is already running and ready to read from the card reader, you should only need to add an image file to your screen for presentation somewhere. Then, based on your finding the appropriate ID, get the record, analyze (if part of the record or just file name in a given images path), get the image file and set the property on the image control to point to the correct image. Then, do whatever logging update that states that Bill just entered the facility.
-- update per comment --
Jenna, I don't know how the original records were added to your table, and it sounds like you were handed this project. The column type within VFP is that of a "General" field. Somewhat like that of a memo field that can also hold binary data, the General data type is more for Object Linking and Embedding (OLE) content. It appears that when users were storing the values, they were adding as a linked or embedded content via something like
APPEND GENERAL YourPictureColumn from SomePath\SomeFileName.bmp
check the syntax under VFP 6 for "APPEND GENERAL". You can also state how via a LINK to the actual file vs EMBEDDING by having the actual image included so if the original source is removed, you still have it in the file.
As for the "picture frame" you see when you double-click this column, it is because VFP does not know how to properly interpret the image, such as as "MS.Paint" class object, or "Picture", or whatever. I've never really liked doing General fields, but would instead have a memo field with just the name of the full path/file name of the image I was keeping and had a separate folder to just stick all the image files. Then, when I needed to show that specific image, I would change the property of the image object on the VFP form to that location.
Now, if that is a route you might like to go with, I'm not exactly sure out to extract those image files, but can look into it more.
As for testing the concept of the image sampling, in VFP, make a new folder for a sample form.
Copy in the folder a few images to sample.
Create a simple table with 2 columns...
CREATE TABLE MyPicSample ;
( PersonName c(10),;
ImgSource m )
Add as many records as images you copied to the test folder. For each, put the file name of the images (full path) into the "ImgSource" memo field, and a sample description for the "PersonName".
Next, create a form, open the data environment and add the "MyPicSample" table just created.
Drag this table from the data environment to the form and it will create a grid on the form. Resize it some you only need a small amount of space to show the one column for PersonName. Close the data environment.
Add an "Image" control to the form. It should default the object name to "Image1"
Double-click on your grid to bring up its code snippet window and then double-click on the "AfterRowColChange" event... paste the following over it..
LPARAMETERS nColIndex
Thisform.Image1.Picture = MyPicSample.ImgSource
Save and run the form. As you scroll up/down the grid, you should see the image change to the respective BMP/JPG file.
I think this is the concept of what you want, but instead of a data table grid displayed, you will be doing this from a scanned card that gets a record, has an image and then present THAT image (now in a General data column type).
Again, not sure how you have your images via embedding or linked, but with this, we can probably get going closer to your end-result needed.
Depends on where you need to upload the image to.
If you are uploading via FTP, you should be able to use the following snippet in Foxpro. It's utilizing the Internet Transfer Control.
inet = CREATEOBJECT("inetctls.inet")
inet.Execute("ftp://ftp.microsoft.com", "CD DIRNAME")
inet.Execute("ftp://ftp.microsoft.com", "PUT LOCALFILE REMOTEFILE")
Related
I am trying to add products by duplicating them in a CSV file. It seems to work fine but when I update the product image path with the same path to multiple products it doesn't seem to update. When I export again and look at the data it has reverted to it original state. What is the problem here...?
Please review the following: http://www.magentocommerce.com/knowledge-base/entry/importing-product-images
Typical Problems:
Path
Name of File (Name does not match file name. ie: Name.jpg vs /name.jpg)
Image file does not exist on server for processing. (file is not at store/media/upload/file.jpg)
Permissions (store/media/* store/media/upload not accessible)
Reminder: When dealing with Image Modification/Upload etc, please flush (disable during trouble shooting) the cache, then re-enable after.
Uploading via Dataflow:
Assuming you have the correct basic required fields, there are two main behaviors.
If the SKU is unique, the product ID will be created in the system.
If the SKU exists, information will be replaced/updated or Appended in the system.
When you copy and paste, you will want to make sure each SKU is unique, and that there will be a correlating image that will 'live' on the server during the upload dataflow process.
In the case of Images, the Path is going to be looking for yourstoreroot/media/import/ for the images you reference in your image / small / thumbnail, if the image doesn't exist with the path described, or doesn't match exactly the name, then the data will not be added/appended in the cart as it is invalid to the import files and would not show on new exports.
To solve this problem I learned how to create an attribute, an attribute set, then a configurable product. With the configurable product I can apply the image once. Each product listing with a different size or color is listed as an associated product with all duplicate content but is not visible individually.
Here is a tutorial that got me started:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-configurable-product
Found this question via Google looking for something similar and thought I'd chime in.
The most common problem I've encountered (and its poorly documented) is that when importing using the built-in import tool, the "image" path must be relative to /media/import/. Note that by default there is no 'import' folder in /media, you'll need to make it.
That means that in your CSV under the "images" column, you should have '/somepicture.jpg', this corresponds to /media/import/somepicture.jpg during the actual import. If this is incorrect, while the import is going on you'll see a bunch of "image not found" errors scroll by, and the existing image data will not be updated.
Unfortunately it does not look like there is a way to simply update the stored image path (such as pointing a bunch of products to the same image) using the built-in importer, as it expects to be importing new images, and will dupe them up just like editing images manually does.
Followed by my last question: Automatically create pages in phpfox
Now I'm trying to assign a list of pre-uploaded images to some pages as their profile picture in phpfox.
After checking data changes in the database, I only realized changes in these two fields:
image_path in table of phpfox_pages (which take a an address to the image file)
user_image in table of phpfox_user (which take a string of "user_id+%s".file_extension)
But by inserting data in these two fields in records for a page that has a default profile pic, it's profile pic would not change.
Is there any other fields or options that I should change?
Look at the file /module/pages/include/service/process.class.php In there look for the function update and around line 442 find this
if ($this->_bHasImage)
This piece of code handles setting an image for the page, notice how it creates three thumbnails, maybe the problem you're having is that you didn't create all the needed thumbs. You also need to update the column image_server_id.
Hope it helps
look phpfox_photo table in that you will find is_profile_photo attribute that is always 1 for the profile picture
i would like to create an image gallery on my homepage in drupal. Each image will have been uploaded by the user, and, as i understand it, will be saved in some image directory folder in drupal. My question concerns a recent tip i picked up in response to the general debate whether or not it is good to store images as blob in mysql. The tip was to store the filenames of the images in mysql so you can essentially still sort the files. I was wondering whether this would be possible even if the files url is in drupal so to speak. It should be possible shouldn't it? I new to programming you see and want to the images on my homepage to be periodically refreshed according to a define sorting function. I would greatly appreciate any response to this question. Cheers.
You can using content types and views module for create gallery in Drupal 7.
First create new content type with gallery name(admin/structure/types/add).
Then add a image field to gallery content type and save it.
If you want have thumbnail of image you should create a image style. for example create a image style with thumbnail_custom name and add suitable effect(admin/config/media/image-styles/add). You will use of this image style in views in the next step.
Then create a new view with gallery-view name. uncheck create a page, check create a block, enter block title and item per page you want(admin/structure/views/add).
In Filter criteria from block details add content type gallery.
In Fields add Content image that appears in node:gallery and select and select thumbnail_custom for image style option.
Save view.
This view block appears in Blocks section and you select region for it.
If you want this block appears only in the front page, in configuration of this block in the section pages of visibility settings check "Only the listed pages" option and then enter "<front>" phrase in textarea.
I have exhausting goggle looking for a way to upload more than one db images.
I had a look at
http://www.mikesdotnetting.com/Article/125/ASP.NET-MVC-Uploading-and-Downloading-Files or http://mattias-jakobsson.net/post/2009/11/19/Handling-image-uploads-with-AspNet-Mvc.aspx or http://www.johnpscott.co.uk/devnotes/picpick/default.aspx or http://rusanu.com/2010/12/28/download-and-upload-images-from-sql-server-with-asp-net-mvc/ and so on. I no luck.
Does anyone has a tutorial or recommend a book that demostrate how to upload more than one db images. I am using vs 2010, asp.net mvc3 in C# with SQL Server 2008R2. All I am trying to do is to have couple db images for each product.
Thanks
The first link you provided is a good start for what you need.
Store all images for a product change....
It shows how to upload multiple files. From this you could modify the table where the images are inserted to add a key for the record relation back to your product.
Retrieve all images for a product change...
To pull them back from the database you would call the code in the same article (GetFile), modifying the select statement to include your product key INSTEAD of the ID of the individual image.
Display all images for a product change...
This is where it changes quite a bit. The author of the first article still returns one file as a FileContentResult. Obviously, this won't work for your situation.
Have a look at this article. It uses an XML file to load up multiple images BUT you would replace this code with the code in GetFiles to create the Image List. It shows how to create a controller, model and view for this. You could create a partial view to have the images on the same page as the product view.
This sample shows how to get an image list out of the DB into a view. (To help with modifying GetFiles to better work for this...)
I am attempting to make a Facebook game and trying to replicate a common function that I usually find in many other Facebook game (a call to my website and illusionary image that is a loading bar).
The function should do the following:
User clicks on Button
Animated Gif Appears (Loading Bar)
Button Update User's Status
Animated Gif Disappears
Facebook Canvas page is updated
The code I currently have can be found at <dead link>
I am having trouble thinking of Step 2 and 4.
I need to optimize Step 5.
To clarify what happens on Step 5. I have Box 1 which has my stats. And Box 2 which has my points. I click on Box 1. This should update Box 1 with 1 points, and update Box 2; minus a point. (Clicking on Box 1, concurrently update both boxes)
I have successfully done this, but it is quite slow. I was wondering if there are alternative way that may be faster than what I am currently doing.
Script Updated with Mark-up. <dead link>
I've found a quick way to optimize the call. Rather than querying for data that I already have query, I will be using the first query to grab most of my data rather than querying it when I update.
It would help greatly to see the document markup (XHTML) where you have your elements and the calls to your javascript functions.
For steps 2 and 4 I recommend using the visibility attribute rather than display, or having the loading bar in an fb:js-string and using elem.setInnerFbml when you begin loading and once you have your response data, simply update it to the new content (you don't need an explicit loading_finish function in this case).
In your get_skillpoint function, you set parameters in an object and then you specify the action parameter again in the URL you are posting to as a URL query param - you may end up with one value overwriting the other, depending on how you access these values on the server side. I would recommend using different names for these two parameters if they are not the same. Also, why are you trying to send separate GET and POST variable sets? You should put everything in the POST and simply leave out the URL query string. I vaguely remember losing data that way in the past (vaguely, mind you).
If you can post your markup I'll update my answer with any light it sheds on the problem. It might be slow simply because Facebook isn't blinding fast when it comes to FBJS and AJAX. Also, FBML being returned must be preprocessed in the FB proxy before your app gets it, which adds a bit of lag; it's a bit faster to return JSON and just pull the data needed out of it, then place the appropriate pieces into an existing element or make use of fb:js-string.