Image

Posted: 2017-01-17 in Image

Q:
A pict listed under “Image Files” of an App, I reference in a WebView section by img src=”pict.jpg”. The pict appears in DevView und DeskView but not in WebPreView! In this case, it will be searched in a temp directory. How should be the img src – reference?
A:
Is your WebView Section based on an rsp script? If so, open the Web App View, click Deploy, then click Preview (or open your browser and go to http://localhost:8001 and open the App from there). You should see your image correctly. (If not, check the inspector in the browser and see if there are any errors.) The Web App View is looking for the image in the temporary directory where the code it generated instead of the App’s directory.


Q:
inserting picture into the grid
A:
Look at the grid column attributes. And yes of course a webview (section or gadget) can display an image, that’s exactly what the catalog view does and the source code is in the library for you to study.
An image object field can be data bound using the “Controlsource” property. Picture is for external file paths.


Q:
Is it possible to place relating pictures from a database table on the screen?
What I ment is: in the tabel textfield only te folder and name of the picture, and the pictures in a separate folder.
Can I place also thumpnails from this fields in a listing ?
A:
The catalogview section provides the ability to display thumbnails of images together with a description and a hyperlink which when clicked calls some code that you can use to slide in a DialogPanel with a much larger image and additional information. You can also specify a filter which contains {…} macros so it only displays images related to a parent section.
Take a look at the web examples how this is done with an imagestrip section.
In web apps the web server typically restricts what folders can be accessed based on file permissions.
In desktop apps this is less of an issue and you should be able to provide thumbnails in a Webview section that you can layout in a .rsp page. Have a look at the catalogview.rsp file in the library directory as it renders images in the HTML that it generates.


Q:
I’ve try to put a image ina grid..
I’ve cretaed a container:

Code:
proc myPictureContainer
mycontainer = createobject("container")
mycontainer.layout = "horizontal"
mycontainer.height = 50
mycontainer.addobject("image1","image")
image.picture = keylookup("Giocatori", "GIOCATORE", azioni.giocatore, pathfoto)
// image.picture = "app:/cat_contacts_sm.png"
return mycontainer

then, added to a gridcell.. but not work..
this code work fine!

Code:
proc myPictureContainer
        mycontainer = createobject("container")
        mycontainer.layout = "horizontal"
        mycontainer.height = 50
        mycontainer.addobject("image1","image")
        image1.picture = keylookup("Giocatori", "GIOCATORE", azioni.giocatore, mline(fotopath, 1))
        image1.Stretch = 1     
return mycontainer

A:
If you use the OBJECTWRITE() function, you can write the image contained in the field to a file. There is an option to write to a temporary (filename generated) file.
So in your myPictureContainer:

Code:
image1.picture = keylookup("Giocatori", "GIOCATORE", azioni.giocatore, objectwrite("",foto,.t.))


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s