NetTalk Central

Author Topic: Image on a form  (Read 3285 times)

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Image on a form
« on: February 03, 2015, 02:02:06 PM »
Hi All,

Clarion 9.1
Nettalk 8.34

I want to display a photo of a staff member on the staff form.  I have looked at the posts but get a little confused as to the steps to do this.
I see the Image type, do I use that and point at a variable with the path to the photo?

Thanks
Brian

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Image on a form
« Reply #1 on: February 03, 2015, 02:11:43 PM »
See image for steps, on the form
field type is image
the field to display can be from a tps file or a literal (C:\something\adam.jpg)
on the display tab set the image to the field

now you can see thi image and its location on the form

K

[attachment deleted by admin]

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Image on a form
« Reply #2 on: February 04, 2015, 01:34:07 AM »
Hi

I am trying to display an image that I have successfully stored in a Blob field in a SQLite table.  On the Form I followed MBIF's instructions (I presume that the field Pro:ImageSmall is a Blob) but got a compile error - 'Variable expected' on the Blob field name.

So, is it possible to get the image in the Blob displayed on a Form?  What's missing?

Thanks

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Image on a form
« Reply #3 on: February 04, 2015, 01:46:10 AM »
Hi Keith
Off topic a bit but beware of SqlLite if you want to use FM3 to upgrade since Bruce advised me that FM3  doesn't support it.
I looked at SqlLite and thought it would be useful but since I am an inveterate tinkerer as far as databases go this would be a showstopper for me.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Image on a form
« Reply #4 on: February 04, 2015, 01:48:35 AM »
Hi Kieth, no my example is not a blob
the handling of a sql table that has a blob is handled in depth in Bruces pdf  "Building Web Applications with NetTalk - Second Edition.pdf"  on pages 74 and 75
"Serving From Blobs "

I dont feel its right to make large extracts from his book without his permission, as the book took him over a week to write.  

The book is found in the Clarion shop

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Image on a form
« Reply #5 on: February 04, 2015, 04:04:34 AM »
Although I know Bruce likes being called Superman I think that it took an awful lot longer than a week to write ;-)
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: Image on a form
« Reply #6 on: February 04, 2015, 01:06:31 PM »
Hi all responders

I have a copy of 'the book' so no worries there  :)

What I want to do is to display on a Form the content of a jpg which is stored in a Blob which is what I thought Brian also wants.  Is this possible?

I have watched 4 Webinars (so far) and learned a lot about Blobs and their use but not how to display a photo on a Form (from a Blob)

The main thrust of allowing photos to be uploaded via File Upload is to store the photo in a folder and the full name of the photo file in the database.  I have successfully stored photos and displayed on a Form using that method but wondered if you could do it directly from the Blob - maybe not.

Terry, on the question of SQLite - I was really just experimenting because one of the functions I want to perform is to export a tps table so that another organisation can load it into their own DB (say MSSQL) and I originally achieved that by writing a comma delimited (ASCII) file from tps.  This worked fine but then  'add photos' was suggested so I though that maybe if I stored the photos in SQLite Blobs and just gave them the SQLite DB that they could extract easier from that 'SQL' DB. I'm not wedded to SQLite and take your points.

Second-lastly, it is worth noting that storing photos in a tps file is probably not a good idea because of the 2GB file size limit - that could easily be breached.

Lastly, Brian, displaying staff photos on a form works if the photo is a separate file and you just point to that.

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

broche

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
Re: Image on a form
« Reply #7 on: February 06, 2015, 09:09:56 AM »
Thanks all,
I will use a jpg on the server in a specific location.

Brian.
Brian