Displaying images (OpenInsight 32-Bit)
At 28 JAN 2005 04:14:47PM Bill Titus wrote:
Old dog trying to learn new tricks…
Our existing fine art museum records each contain complete path data to image files. I need to display the images within the object record data entry form - a compelling reason for our move from ARev to OI.
I know it can be done; I just need a bit of help in how to do it! Any assistance - specific or general - greatly appreciated.
Thanks.
Bill
At 28 JAN 2005 04:39PM Donald Bakke wrote:
Bill,
I think you would be interested in the IMAGE property. This allows you to take the raw binary information of an image and pass it to a BITMAP control as a variable.
Storing binary data in linear hash is relatively simple. Just OSRead the file and write it to your table. This assumes a one record per one graphic image relationship. If there is some need to store multiple binary images in a single record then you will want to use the VB conversion (wouldn't hurt to use the VB conversion anyway).
I'm not sure why storing images within the database makes OI more compelling but some here would argue that your linear hash tables would become quite large and unwieldy over a significant period of time.
At 28 JAN 2005 05:42PM [email protected] wrote:
Bill - we're reading your request as saying that you store the NAME of the picture including path in the record and that you wish to display the image on screen. This used to be possible with third party add ons in AREV and probably still is - however it is VERY easy in OI. You just add a BITMAP control to the screen and on a post read (so perhaps a quick event) add something that sets the BITMAP property of the control to the name of the file to display.
As Don points out you can also store the image as a column/row in the database although we'd suggest that a VB conversion would be imperative here so as not to confuse with system delimiters. This is especially useful when you don't want casual browsers using Windows Explorer opening your jpgs/bmps etc
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 28 JAN 2005 07:28PM Pat McNerthney wrote:
Alternatively, you could store the bitmaps as the entire record of an LH file decicated to that purpose. Then there would be no need for the VB conversion.
However, the simplest solution for this existing application is to use the BITMAP property, which wants the file name of a bitmap to use.
Pat
At 29 JAN 2005 08:49AM Warren Auyong wrote:
I think Bill is more excited about the ability to display/preview the image in the entry form rather then being able to actually store it in a LH file :)
At 29 JAN 2005 09:19AM Jim Eagan wrote:
Bill here is code used to get a personnel photo-id should translate easily. It is placed on the read event.
Declare Function Get_Property, Set_Property ; Declare Subroutine Forward_Event
win_name=CtrlEntId1,'.'
Forward_Event() ; * Do this otherwise the record will not have been read yet.
vis=set_property(win_name:".BITMAP_1", "VISIBLE",0) ;* reset to invsible
key=get_property(win_name, "ID")
bmp_key=C:\FIRMDATA\Picids\":key:".BMP"
No_Pic="
OSOPEN bmp_key TO TABLEVAR ELSE No_Pic=1
If No_Pic then
null ;* no picture=do nothingEnd Else ;* else set the bitmap and make it visiblenew_bmp=set_property(win_name:".BITMAP_1", "BITMAP",bmp_key)vis=set_property(win_name:".BITMAP_1", "VISIBLE",1)END
At 29 JAN 2005 12:00PM Bill Titus wrote:
Jim - The code is a great help, thank you.
Warren - You're right. I'll have a real, not a kludged, image viewing solution.
Jim and Sprezz - If I understand correctly, event handling is bound to controls. My window has two editlines - the record key and the imageid field - and the bitmap control. Where does Jim's code go?
Thanks for bearing with me.
Bill
At 29 JAN 2005 12:09PM [email protected] wrote:
On the READ event of the Window.
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 29 JAN 2005 01:02PM dsig _at_ sigafoos.org wrote:
Bill,
I would strongly suggest that you do not put the image in the OI record itself but, as it seems you are currently doing, just store the link.
If for no other reason than 'portability' of the image itself .. once in OI it is OIs ..
dsig _at_ sigafoos.org.com onmouseover=window.status=the new revelation technology .. a refreshing change;return(true)"
David Tod Sigafoos ~ SigSolutions
At 29 JAN 2005 01:04PM Bill Titus wrote:
Thanks very much.
I guess Jim's code was set up as a control event so I had to modify it as follows. I needed to explicitly specify the window name COLLECTION and the bmp_key value to get it to work. But it works fine!
What's the proper way to retrieve the window name and bmp_key from the data record once it's read?
Declare Function Get_Property, Set_Property
Declare Subroutine Forward_Event
win_name=CtrlEntId1,'.'
Forward_Event() ; * Do this otherwise the record will not have been read yet.
vis=set_property("COLLECTION.BITMAP_1", "VISIBLE",0) ;* reset to invsible
bmp_key=d:\images\achen001.bmp"
No_Pic="
OSOPEN bmp_key TO TABLEVAR ELSE No_Pic=1
If No_Pic then
null ;* no picture=do nothing
End Else ;* else set the bitmap and make it visible
new_bmp=set_property("COLLECTION.BITMAP_1", "BITMAP",bmp_key)
vis=set_property("COLLECTION.BITMAP_1", "VISIBLE",1)
END
RETURN 0
At 29 JAN 2005 01:08PM Bill Titus wrote:
If I needed to secure the images, putting them in OI might be an excellent option.
But I'm not going to protect the images from other users, and I also want to keep my record size < 30K, so I'll keep the links in OI and the images elsewhere.
Thanks for your input.
At 29 JAN 2005 01:29PM dsig _at_ sigafoos.org wrote:
There are other ways to protect them in the directory .. so you choice is best
dsig _at_ sigafoos.org.com onmouseover=window.status=the new revelation technology .. a refreshing change;return(true)"
David Tod Sigafoos ~ SigSolutions
At 29 JAN 2005 01:36PM Donald Bakke wrote:
Bill,
Within your event code you should always use the system variable @Window as a way to identify the current window name. Jim hard-coded this name as you noted. However, this can be dangerous if your window is multi-instance, i.e., allows multiple copies to be executed at the same time. OI appends a *1, *2, *3, etc., to the window name for each instance that is running as a way of giving them a distinct name.
There are two ways to get the BMP key after the record has been read. First is to use the TEXT property of the control that stores this key:
BMP_Path=Get_Property(@Window:".BMP_PATH", "TEXT")
Another would be to use an AREV technique:
Record=Get_Property(@Window, "RECORD")
* Alternatively, @RECORD could also be used instead
BMP_Path=Record ; * assumes BMP path is stored in field 2
At 29 JAN 2005 01:55PM Bill Titus wrote:
Thank you, Don, and everyone. I added CLEAR and SAVE events to set the visibility of the bitmap back to 0. Cool.
At 11 JAN 2006 05:45PM Dan Reese wrote:
In case anyone is still trying to pursue something like this in arev…
You don't really need 3rd party add-ons. Just SUSPEND "cmd.exe /c start ":imageFileSpec. Windows will launch the program associated with the file type in a separate process.
If you want more control over the output, just write out a small html document that refers to your image, then replace imageFileSpec with htmlFileSpec in the above command. You can do just about anything you want, and launch as many concurrent Windows processes as you want FROM AREV. You could also display a bunch of images FROM a single html file, along with text and other embellishments.
At 12 JAN 2006 08:03AM Bob Carten wrote:
If you are launching HTML from Arev (or OI via Utility runwin) try using an extension of .hta rather than .htm
hta stands for HTML application. It is available in IE5 or higher.
You get a window that does not look like a browser, and which runs as a trusted application, like a GUI vbscript. You can edit files, link to other websites, lauch apps, etc. Microsoft enabled this in the days of the 'digital desktop'. MSoutlook is an example of the digital desktop.