Alpha Video Training
Results 1 to 5 of 5

Thread: Insert a default Image in a field.

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

    Default Insert a default Image in a field.

    What is the syntax to insert an image as a default into an Image Reference Field?
    I know how (thanks to Stan and others) to get the image path OUT of the image displayed, but struggling with the syntax to set one up as a default.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  2. #2
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,858

    Default Re: Insert a default Image in a field.

    Ted,

    I'm not sure that this is exactly what you are asking for, but I'll give it a shot.

    We have an employee badge system where we take pictures and signatures to create badges. I've set up "default" jpg images in the "photo" folder. One that has just a plain background with the phrase, "No photo exists", and another, for the signature, that states "Signature not on file". On our form, I've set the "default" bitmap to the appropriate jpg's. In the on_fetch event, I check to see if the photo and signature files exist and I reset the bitmap fields to the appropriate ones.

    On_fetch code:
    Code:
    'Date Created: 17-Aug-2007 02:59:06 PM
    'Last Updated: 08-Jan-2018 12:09:46 PM
    'Created By  :
    'Updated By  : Thomas Henkel
    'debugcheck()
    dim tc as P
    tc = table.current()
    dim Shared pict AS C
    pict = alltrim(str(tc.Badge_No,9,0))
    bmpfile = mpath+chr(92)+"bcbss\photo"+chr(92)+alltrim(str(tc.Badge_No))+".jpg"
    	
    if .not.file_exists(bmpfile) then
    	bmpfile = mpath+chr(92)+"bcbss\photo"+chr(92)+"not_avail.jpg"
    end if
    
    sigfile =cSigs_path+chr(92)+alltrim(str(tc.badge_no))+"s.jpg"
    	
    if .not.file_exists(sigfile) then
    	sigfile = mpath+chr(92)+"bcbss\photo"+chr(92)+"blanksig.jpg"
    end if
    	
    topparent:Bitmap1.bitmap.filename = word(bmpfile	,1,"<")
    topparent:Bitmap2.bitmap.filename = sigfile
    
    xbasic_wait_for_idle()
    
    'Toggle the "Inactive" message.
    if tc.is_marked()
    	'topparent:Inactive01.show()
    	'Set 'Text' property of 'Inactive01' in Form 'fEE_Badge' .
    	parentform:Inactive01.text = "(Inactive)"
    else
    	'topparent:Inactive01.hide()
    	parentform:Inactive01.text = ""
    end if
    topparent:Inactive01.refresh()
    Hope this helps,

    Tom
    Attached Images Attached Images

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

    Default Re: Insert a default Image in a field.

    Thanks Tom, very close.
    In my situation, when a new record is created, 11 images have to be added one at a time. To simplify matters, I want to create a "No Picture" .bmp in all 11 un populated fields.
    So the default expression is what I am struggling with.
    I'll look closely at your suggestion, and thanks once again.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

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

    Default Re: Insert a default Image in a field.

    Nope, still cannot get it to work.
    This is what I put in the Default value for the Image Reference Field (IRF) ; "d:\my folder_name\nopic.jpg"
    What I am trying to achieve, is that when a new record is entered, the default extension is .jpg.
    I have worked with Stan's suggestions in order to try and show only .jpg images when selecting one, but Windows7 takes over if the IRF is blank, and shows .bmp first, so the user has to navigate to .jpg.
    When the IRF is populated with a default .jpg, Alpha forces Windows to show the .jpg images.

    I have bashed my head on this for quite a while now, so if anyone has a way of getting an Image Reference Field to display a default image - from the Default Field Rules, I would be eternally grateful.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

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

    Default Re: Insert a default Image in a field.

    Well I finally got it to work.
    By setting a Varchar as the image I am after and where it resides, the Default Field Rule with the Varchar in it now works and the IMR filed is populated as I need it.
    This is odd, because I had tried that earlier - well I think I had - and not managed to get it to work.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Detecting Null Image Field and/or Default Image
    By nlk10010 in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 05-24-2016, 10:13 AM
  2. Insert image from URL
    By SuperMarc92 in forum Alpha Five Version 11 - Desktop Applications
    Replies: 1
    Last Post: 10-01-2013, 04:59 PM
  3. How to insert value for one field when we click on image?
    By Suvarchala in forum Application Server Version 11 - Web/Browser Applications
    Replies: 0
    Last Post: 01-10-2012, 02:09 AM
  4. put a variable for default insert new records
    By jfhg in forum Application Server Version 8
    Replies: 5
    Last Post: 03-03-2008, 10:52 AM
  5. insert image wreaks havoc...
    By Steve Loumakis in forum Web Application Server v6
    Replies: 0
    Last Post: 03-24-2005, 09:45 AM

Bookmarks

Posting Permissions

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