My understanding reading the documentation for GET_DIB_SIZE@, GET_DIB_BLOCK@, and DISPLAY_DIB_BLOCK@ is that these should work identically for both .bmp and .jpg files. I have used these functions just fine for quite some time for .bmp files, but in an attempt to extend this to include .jpg files have found that the DIB display doesn't seem to work for .jpg.
Using a simple .bmp and .jpg file for the same picture (~300x300), when I run the following program for the .bmp file it works fine, but it displays a garbled image when I swap the data statement to open the .jpg file. Is there something else different about processing .bmp and .jpg files that I should be aware of?
Thanks, Dennis
WINAPP 300000,500000
PROGRAM JPG
INTEGER*1 IBFFER(3,200000)
CHARACTER*30 JPGFIL
INCLUDE <WINDOWS.INS>
C DATA JPGFIL/'C:\DEV\SYSLB\JPG.BMP'/ DATA JPGFIL/'C:\DEV\SYSLB\JPG.JPG'/
I=WINIO@('%GR%LW',400,400,IHANDL)
PRINT *,JPGFIL
CALL GET_DIB_SIZE@(JPGFIL,IWID,IHIT,INBP,IERR)
PRINT *,IWID,IHIT,INBP,IERR
CALL GET_DIB_BLOCK@(JPGFIL,IBFFER,400,400,0,0,
& 400,400,0,0,IERR)
PRINT *,IERR
CALL DISPLAY_DIB_BLOCK@(0,0,IBFFER ,
& 400,400,
& 0,0,
& 400,400,
& 0,0,IERR)
STOP
END