Skip to main content

[archive] CALL "w$bitmap"

  • July 1, 2008
  • 5 replies
  • 0 views

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.

5 replies

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.
Hi

When I tried the following,

CALL "w$bitmap" using wbitmap-LOAD, WS-FILENAME
GIVING WS-LOAD-HANDLE.


I am getting positive value in WS-LOAD-HANDLE when WS-FILENAME has less than 60 characters. Getting -1 when WS-FILENAME has more than 60 characters, means error in loading the bitmap. Why it is limited to 60?
Is there any setting in config.sys file to solve this?

help me!!

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.
Your problem is elsewhere. I have no issues loading a file with more than 60 character filename.

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.
Your problem is elsewhere. I have no issues loading a file with more than 60 character filename.

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.
Thanks for your reply, but It is set up as a PIC x(126).

[Migrated content. Thread originally posted on 01 July 2008]

Have you checked the length of WS-FILENAME?

It may be set up as a PIC x(60) field and the name passed to it being greater than 60 characters is being truncated, thus causing a -1 to be returned.
I assume that since the name passed to W$BITMAP is so long that it includes the path. As a test move the image file to the current directory so there is no path in the name. If that succeeds then it may be a permissions issue with the location of the image file. If that fails then the image may not be a type that is supported by W$BITMAP.

Here is the relevant portion of the W$BITMAP documentation:

W$BITMAP will examine files to determine the type of image format. If the file suffix is ".jpg", ".jpe" or ".jpeg", W$BITMAP assumes the file is a JPEG image. Otherwise, it assumes the files are in BMP format. In order to read JPG files, you must have the file "ajpg32.dll" installed in the runtime directory. Only 32-bit runtimes support JPEG format images. If you need JPEG support on 64-bit Windows, run the 32-bit runtime or the Thin Client. You can also run the Thin Client with the 64-bit runtime.

W$BITMAP loads 24-bit color or 8-bit grayscale images in the JPEG File Interchange Format (JFIF). It reads baseline and extended DCT sequential and progressive files that are Huffman encoded (file types SOF0, SOF1, SOF2). The JPG lossless mode format is not supported.