News:

OS2World.com Forum is back !!!

Remember to visit OS2World at:
http://www.os2world.com

Main Menu

DBExpert

Started by Bernt_Z, April 16, 2025, 12:44:22 PM

Previous topic - Next topic

Bernt_Z

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.

Bernt_Z

Oh, forgot, it's in the Form tab.

Jan-Erik Lärka

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

Bernt_Z

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

Bernt_Z

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

Jan-Erik Lärka

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?

Jan-Erik Lärka

#6
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.

Bernt_Z

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!

Jan-Erik Lärka

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'