# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1322883648 0 # Node ID 36d0e26a5deaff9f7350a40282bb5175676c9215 # Parent 1bb1865fed9d91df6701abe947e556cba11d555e Use the image handle to get the dimensions on OS/2. diff -r 1bb1865fed9d -r 36d0e26a5dea os2/dw.c --- a/os2/dw.c Sat Dec 03 03:31:43 2011 +0000 +++ b/os2/dw.c Sat Dec 03 03:40:48 2011 +0000 @@ -4726,14 +4726,19 @@ /* Bitmap/Static */ else if(strncmp(tmpbuf, "#5", 3)==0) { - int bmwidth = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_width")); - int bmheight = DW_POINTER_TO_INT(dw_window_get_data(handle, "_dw_height")); - - if(bmwidth > 0 && bmheight > 0) - { - thiswidth = bmwidth; - thisheight = bmheight; - } + HBITMAP hbm = (HBITMAP)WinSendMsg(handle, SM_QUERYHANDLE, MPVOID, MPVOID); + + if(hbm) + { + BITMAPINFOHEADER2 bmp; + bmp.cbFix = sizeof(BITMAPINFOHEADER2); + /* Get the parameters of the bitmap */ + if(GpiQueryBitmapInfoHeader(hbm, &bmp)) + { + thiswidth = bmp.cx; + thisheight = bmp.cy; + } + } } /* Ranged: Slider/Percent/Scrollbar */ else if(strncmp(tmpbuf, "#38", 4)== 0 ||