OS2 World Community Forum

OS/2, eCS & ArcaOS - Technical => Applications => Topic started by: Bernt_Z on April 16, 2025, 12:44:22 pm

Title: DBExpert
Post by: Bernt_Z on April 16, 2025, 12:44:22 pm
Can anyone tell me howto change bitmap path to bitmaps. Currently those reside in DBEXPERT folder, I want to move the bitmap pics to another folder.
Title: Re: DBExpert
Post by: Bernt_Z on April 16, 2025, 01:28:12 pm
Oh, forgot, it's in the Form tab.
Title: Re: DBExpert
Post by: Jan-Erik Lärka on April 16, 2025, 07:01:06 pm
To create a bitmap control that displays a picture from a disk file:  

1.Click the bitmap control tool [tree and house] in the control tool box   

2.Click on the form where you want the top left corner of the bitmap to appear   

3.Set the Source attribute to =LoadPicture(`filename') where filename is the name of the file the picture is in. For example, =LoadPicture( `os2.bmp' )
____
Skip to 3. to adjust existing bitmap control and specify the path to the bitmap.
I think you may need to specify the full path or no path, but try if you can use relative path with "..\" for parent folder, something like ..\..\other\WHOOPI.BMP for parents-parent-folder-containing-folder-other-with-bitmap
Title: Re: DBExpert
Post by: Bernt_Z on April 17, 2025, 12:10:36 pm
Sorry, but it didn't work out
If I undetstood right, some examples:
=LoadPicture(\PICS\bildfil) relative
=LoadPicture(E:\MUSICPIC\bildfil) absolute. It doesn't matter if I use Drive letyer or not.
I apprechiate all suggestions!
Thanks, Bernt Zurcher
Title: Re: DBExpert
Post by: Bernt_Z on April 17, 2025, 12:54:58 pm
To clearify:
E:\DBEXPERT\  pictures location
E:\DBEXPERT\
E:\DBEXPERT\PICS\ alternative to pics location
E:\DBEXPERT\TUTORIAL\ where my application is located
E:\MUSICPIC\ where I prefer pics
Title: Re: DBExpert
Post by: Jan-Erik Lärka on April 18, 2025, 10:25:31 am
Save the form as a report and open the report.
Do you see the picture there?

I suspect that you only see a white background as it is?
And no change if you use =dbeLoadPicture('c:\path\2\picturefile.bmp') either?
Title: Re: DBExpert
Post by: Jan-Erik Lärka on April 18, 2025, 11:58:38 am
Also note that the form has to be tied to a database table.
It seem as if it only try to read the file if it also has initialized a record.
Title: Re: DBExpert
Post by: Bernt_Z on April 21, 2025, 11:48:13 am
Thanks for the help, but I couldn't figure out. Lack of knowledge. I solved it by adding drive and path in front of pic.files.
Jan-Erik, is there a way to add drive and path to a pic file in DBEXPERT without using REXX scripts?
Anyway, thanks for all the suggestions!
It must have been like 15 years ago I created the application!
Title: Re: DBExpert
Post by: Jan-Erik Lärka on April 23, 2025, 05:54:14 pm
You're welcome! :)

Hard code the path or use rexx.

In the current folder:
SAY DIRECTORY()||'\myimage.bmp'

parent folder ( note the omitted \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', DIRECTORY() )||'myimage.bmp'

parents parent folder ( must strip the trailing \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', STRIP( FILESPEC( 'Path', DIRECTORY() ), 'Trailing', '\' ) )||'myimage.bmp'

another folder relative parents parent folder ( must strip the trailing \ ):
SAY FILESPEC( 'Drive', DIRECTORY() )||FILESPEC( 'Path', STRIP( FILESPEC( 'Path', DIRECTORY() ), 'Trailing', '\' ) )||'otherfolder\myimage.bmp'