Get a Jumpstart with our Sample Apps
Results 1 to 22 of 22

Thread: Show an image from just an image file path in a DT Form

  1. #1
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Show an image from just an image file path in a DT Form

    This is an SQL back end.
    The image file path is an image in a local Windows folder.
    I can only use the image path and this comes from a field in the SQL table.

    How do I show the image without saving it in a Desk Top environment?
    All I have to go on is the file path.

    PS, if I am not allowed to use any DBF field types.
    Happy to use a Grid if that will work.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,695

    Default Re: Show an image from just an image file path in a DT Form

    sys_open() ?

    sys_open(sql_lookup("{A5API=Access,FileName='C:\Alpha\a5V11\MDBFiles\Alphasports.mdb',UserName='Admin'}","customer","customer_id = 1","company"))

    works here if I modify the AlphaSports mdb and put an image file path in the company field in the customer table.
    Last edited by Stan Mathews; 11-20-2017 at 05:52 PM.
    There can be only one.

  3. #3
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    Is Xdialog out of question?

    There you can activate chrome browser

    dim cp as helper::Chrome

    and then use <a> tag almost like in web page.

    Ken

  4. #4
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    That was quick gents!
    I will try it tomorrow.
    Getting late here now.
    I have 12 images to show so that will be fun!
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  5. #5
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    I might have spoken too soon. Each of the 12 images has to appear in a specific image frame, say 1 inch square.
    Will that fit in a calculated field?
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,695

    Default Re: Show an image from just an image file path in a DT Form

    A calculated field doesn't have a height and width. What are you trying to do?
    There can be only one.

  7. #7
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    If xdialog...

    You could make thumbnails of your photos using node for example using jimp and then show them using <table> and <img> tag and css in chrome inside xdialog. Or just use some jquery plugin for nicer output with xdialog.

  8. #8
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    @Stan.

    The process;
    Create master record,
    Select image path from folder (12 images, separate paths),
    Store image path,
    Display image from image folder.

    Background.
    The client wants to display 12 images on a tabbed form.
    Images are viewed in a windows folder and selected for use with the record on view.
    The image source is a windows folder and path on their PC.
    All 12 images are linked to the record being displayed. All images have their own path and this is and must be held on the SQL table as 12 separate paths.

    So, I need to be able to select an image and save the full path to the SQL table and then display that image on a form using the specific path.

    The things I have tried;
    Uploading the image to the SQL table as a BLOB/Bitmap. This is the easiest option but means redundancy as the images will be in 2 places. Not an option.
    Using an Image Reference Field. This stores only the file path and shows the image. Unfortunately SQL does not have the same functionality.

    Creating a Set with a DBF table to use as a transaction table.
    Set would be;

    SQL Table.
    ..Record ID
    DBF
    ..Record ID
    ..Image File Reference1
    ..Image File Reference2
    ..Image File Reference3
    Etc
    Link = Record ID

    There will be some redundancy as the file paths will be held in 2 places. By my calculations there will be approximately 3meg of redundant data over 200,000 records. The benefit of this approach is that the file path and image are both readily available without saving the image in 2 places. It would make capturing the file path easier to insert into the SQL table too.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  9. #9
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    Why not us xdialog to directly show photos from folder and then select the image and save path to sql. No extra steps.

    Here is link to little showcase:)

    Ken

  10. #10
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,364

    Default Re: Show an image from just an image file path in a DT Form

    Quote Originally Posted by kkfin View Post
    Why not us xdialog to directly show photos from folder and then select the image and save path to sql. No extra steps.

    Here is link to little showcase:)

    Ken
    Very cool... could you post the files and code for this?

  11. #11
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    You can put code together from release notes. Not very new stuff. It is in from year 2013. Nothing special in my code. I just use button around image tag to get event fired then get value of image tag src.

    Ken

  12. #12
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    6,364

    Default Re: Show an image from just an image file path in a DT Form

    I see

  13. #13
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    That isn't the requirement Ken.
    I need to select AND SHOW ON A FORM 12 images so they can be used in creating a PDF.
    The images need to be repeatable for legal reasons.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  14. #14
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    You have put many posts put I must say I still do not know what your are trying to do.

    You write that images are viewed in windows folder and selected (right?) to view in form. You save the path of selected photos in sql.(right?)
    And when you know the path you can show these 12 photos in form(right?) If so then where is the problem you want to help?


    Ken

  15. #15
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    Ok, you try it.
    Show me 12 images from 12 paths in a single form.
    Image layout is 6 down, 2 across.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  16. #16
    "Certified" Alphaholic
    Real Name
    Finian Lennon
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    1,738

    Default Re: Show an image from just an image file path in a DT Form

    Not what Ken is suggesting, but one way to do this is the way I print the images associated with the tickets in our app, which is to say, using a temp table. We may have to get images from 2 locations (but the number of locations wouldn't matter) i.e. current images and stored images and we never know which.

    Your temp table would have 12 Image Reference fields and whatever other ID fields you need to tie the whole thing together

    I'm a little confused about your path information but, assuming that you have a way to get the path location of the files, then you can use filefind.get() to retrieve the image names in each folder, aggregate those and then write the path+ filenames into the 12 IFR fields in the temp table. If the table will be used with multiple users simultaneously, you need a field for the user ID and then query for and zap the user's records each time you populate the temp table with images for that user. Sounds laborious but works very quickly in operation.
    Finian

  17. #17
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Posts
    1,301

    Default Re: Show an image from just an image file path in a DT Form

    Quote Originally Posted by Ted Giles View Post
    Ok, you try it.
    Show me 12 images from 12 paths in a single form.
    Image layout is 6 down, 2 across.
    If you would use Xdialog it would be dead easy. To my original just add table tag. Six rows and two columns.
    I do not use forms so I leave forms for others.

    But how I have done this is not possible in forms because they do not support chrome.
    Because of this chrome support in Xdialog only developers skills limit what you can do. In forms you just have to use what is given to you.

    Here is table version.

    Ken
    Last edited by kkfin; 11-22-2017 at 01:52 AM.

  18. #18
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    Thanks Finian, that is what I have tried also and it works. I can parse the file location and instead of a temp table, I will be using a table with IFR fields in a Set with the main table. I'll be separating the images from the main table.
    @Ken, I have to use forms so your solution is not for me.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  19. #19
    "Certified" Alphaholic
    Real Name
    Govindan Gandhi
    Join Date
    Aug 2008
    Location
    New York, NY
    Posts
    4,294

    Default Re: Show an image from just an image file path in a DT Form

    good morning ted,
    you have two threads running and it looks like they are related.
    is there a place to use
    c fully_qualified_filename = a5_qualify_filename(c input file)
    to get the fully qualified name of the image file you could use that in the calculated function, right?
    from the windows file directory.
    or that is not good?
    thanks for reading

    gandhi

    version 11 3381 - 4096
    mysql backend
    http://www.alphawebprogramming.blogspot.com
    ggandhi344@gmail.com
    Skype:ggandhi344@gmail.com
    1 914 924 5171

  20. #20
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    Good thinking G.
    I have it working but this looks a little more efficient so I will try it.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

  21. #21
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Michigan
    Posts
    4,110

    Default Re: Show an image from just an image file path in a DT Form

    Hi Ted,
    I am a little late here but I have this same situation to display art files in our art library (form pic attached). I display 15 files at a time. The form has 15 bitmap objects named 1-15 and the SHOW button on the browse begins a loop that sets the filename for the bitmap object resulting in the objects displaying the images. Atop each bitmap object is a button that opens the selected image in a larger viewer using sys_open(). it all works beautifully. Get in touch with me and I can get you a more workable example if you like.
    Attached Images Attached Images
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  22. #22
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    3,809

    Default Re: Show an image from just an image file path in a DT Form

    Thanks Mike, rude of me not to reply earlier.
    I will be in touch, many thanks.
    Ted Giles
    Example Consulting - UK
    .

    https://exampleltd.example-software.com/

Similar Threads

  1. Control Type Image shows path instead of image?
    By JSChasle in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 09-14-2016, 06:00 AM
  2. Image File Reference Field - show in a data bound Image on UX?
    By TheSmitchell in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 02-25-2016, 02:27 PM
  3. Image/File path upload/capture
    By wburchell in forum Application Server Version 10 - Web/Browser Applications
    Replies: 5
    Last Post: 02-25-2011, 09:23 AM
  4. Image file path into a list view
    By Clunes in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 03-31-2010, 04:02 PM
  5. Image File Path Prompt
    By DRW in forum Alpha Five Version 9 - Desktop Applications
    Replies: 0
    Last Post: 10-23-2009, 03:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •