4 * Copyright 1993 Alexandre Julliard
11 #include <X11/Xutil.h>
20 #ifdef PRELIMINARY_WING16_SUPPORT
21 #include <sys/types.h>
26 /* GCs used for B&W and color bitmap operations */
27 GC BITMAP_monoGC
= 0, BITMAP_colorGC
= 0;
29 extern void CLIPPING_UpdateGCRegion( DC
* dc
); /* objects/clipping.c */
32 /***********************************************************************
35 * Wrapper to call XPutImage with CALL_LARGE_STACK.
38 struct XPutImage_descr
46 static int XPutImage_wrapper( const struct XPutImage_descr
*descr
)
48 return XPutImage( display
, descr
->bmp
->pixmap
, BITMAP_GC(descr
->bmp
),
49 descr
->image
, 0, 0, 0, 0, descr
->width
, descr
->height
);
53 /***********************************************************************
54 * CreateBitmap16 (GDI.48)
56 HBITMAP16 WINAPI
CreateBitmap16( INT16 width
, INT16 height
, UINT16 planes
,
57 UINT16 bpp
, LPCVOID bits
)
59 return CreateBitmap32( width
, height
, planes
, bpp
, bits
);
63 /***********************************************************************
64 * CreateBitmap32 (GDI32.25)
66 HBITMAP32 WINAPI
CreateBitmap32( INT32 width
, INT32 height
, UINT32 planes
,
67 UINT32 bpp
, LPCVOID bits
)
69 BITMAPOBJ
* bmpObjPtr
;
72 planes
= (BYTE
)planes
;
75 dprintf_gdi( stddeb
, "CreateBitmap: %dx%d, %d colors\n",
76 width
, height
, 1 << (planes
*bpp
) );
78 /* Check parameters */
79 if (!height
|| !width
|| planes
!= 1) return 0;
80 if ((bpp
!= 1) && (bpp
!= screenDepth
)) return 0;
81 if (height
< 0) height
= -height
;
82 if (width
< 0) width
= -width
;
84 /* Create the BITMAPOBJ */
85 hbitmap
= GDI_AllocObject( sizeof(BITMAPOBJ
), BITMAP_MAGIC
);
86 if (!hbitmap
) return 0;
87 bmpObjPtr
= (BITMAPOBJ
*) GDI_HEAP_LOCK( hbitmap
);
89 bmpObjPtr
->size
.cx
= 0;
90 bmpObjPtr
->size
.cy
= 0;
91 bmpObjPtr
->bitmap
.bmType
= 0;
92 bmpObjPtr
->bitmap
.bmWidth
= (INT16
)width
;
93 bmpObjPtr
->bitmap
.bmHeight
= (INT16
)height
;
94 bmpObjPtr
->bitmap
.bmPlanes
= (BYTE
)planes
;
95 bmpObjPtr
->bitmap
.bmBitsPixel
= (BYTE
)bpp
;
96 bmpObjPtr
->bitmap
.bmWidthBytes
= (INT16
)BITMAP_WIDTH_BYTES( width
, bpp
);
97 bmpObjPtr
->bitmap
.bmBits
= NULL
;
99 /* Create the pixmap */
100 bmpObjPtr
->pixmap
= XCreatePixmap(display
, rootWindow
, width
, height
, bpp
);
101 if (!bmpObjPtr
->pixmap
)
103 GDI_HEAP_FREE( hbitmap
);
106 else if (bits
) /* Set bitmap bits */
107 SetBitmapBits32( hbitmap
, height
* bmpObjPtr
->bitmap
.bmWidthBytes
,
109 GDI_HEAP_UNLOCK( hbitmap
);
114 /***********************************************************************
115 * CreateCompatibleBitmap16 (GDI.51)
117 HBITMAP16 WINAPI
CreateCompatibleBitmap16(HDC16 hdc
, INT16 width
, INT16 height
)
119 return CreateCompatibleBitmap32( hdc
, width
, height
);
123 /***********************************************************************
124 * CreateCompatibleBitmap32 (GDI32.30)
126 HBITMAP32 WINAPI
CreateCompatibleBitmap32(HDC32 hdc
, INT32 width
, INT32 height
)
128 HBITMAP32 hbmpRet
= 0;
131 dprintf_gdi( stddeb
, "CreateCompatibleBitmap(%04x,%d,%d) = \n",
132 hdc
, width
, height
);
133 if (!(dc
= DC_GetDCPtr( hdc
))) return 0;
134 hbmpRet
= CreateBitmap32( width
, height
, 1, dc
->w
.bitsPerPixel
, NULL
);
135 dprintf_gdi(stddeb
,"\t\t%04x\n", hbmpRet
);
140 /***********************************************************************
141 * CreateBitmapIndirect16 (GDI.49)
143 HBITMAP16 WINAPI
CreateBitmapIndirect16( const BITMAP16
* bmp
)
145 return CreateBitmap16( bmp
->bmWidth
, bmp
->bmHeight
, bmp
->bmPlanes
,
146 bmp
->bmBitsPixel
, PTR_SEG_TO_LIN( bmp
->bmBits
) );
150 /***********************************************************************
151 * CreateBitmapIndirect32 (GDI32.26)
153 HBITMAP32 WINAPI
CreateBitmapIndirect32( const BITMAP32
* bmp
)
155 return CreateBitmap32( bmp
->bmWidth
, bmp
->bmHeight
, bmp
->bmPlanes
,
156 bmp
->bmBitsPixel
, bmp
->bmBits
);
160 /***********************************************************************
163 * Get an X image for a bitmap. For use with CALL_LARGE_STACK.
165 XImage
*BITMAP_GetXImage( const BITMAPOBJ
*bmp
)
167 return XGetImage( display
, bmp
->pixmap
, 0, 0, bmp
->bitmap
.bmWidth
,
168 bmp
->bitmap
.bmHeight
, AllPlanes
, ZPixmap
);
172 /***********************************************************************
173 * GetBitmapBits16 (GDI.74)
175 LONG WINAPI
GetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPVOID buffer
)
177 return GetBitmapBits32( hbitmap
, count
, buffer
);
181 /***********************************************************************
182 * GetBitmapBits32 (GDI32.143)
184 LONG WINAPI
GetBitmapBits32( HBITMAP32 hbitmap
, LONG count
, LPVOID buffer
)
187 LONG height
, old_height
;
194 fprintf(stderr
, "Negative number of bytes (%ld) passed to GetBitmapBits???\n", count
);
197 bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
200 /* Only get entire lines */
201 height
= count
/ bmp
->bitmap
.bmWidthBytes
;
202 if (height
> bmp
->bitmap
.bmHeight
) height
= bmp
->bitmap
.bmHeight
;
203 dprintf_bitmap(stddeb
, "GetBitmapBits: %dx%d %d colors %p fetched height: %ld\n",
204 bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
,
205 1 << bmp
->bitmap
.bmBitsPixel
, buffer
, height
);
208 GDI_HEAP_UNLOCK( hbitmap
);
212 switch (bmp
->bitmap
.bmBitsPixel
) {
214 if (!(bmp
->bitmap
.bmWidth
& 15))
217 pad
= ((16 - (bmp
->bitmap
.bmWidth
& 15)) + 7) / 8;
220 if (!(bmp
->bitmap
.bmWidth
& 3))
223 pad
= ((4 - (bmp
->bitmap
.bmWidth
& 3)) + 1) / 2;
226 pad
= (2 - (bmp
->bitmap
.bmWidth
& 1)) & 1;
230 pad
= 0; /* we have 16bit alignment already */
233 pad
= (bmp
->bitmap
.bmWidth
*3) & 1;
236 fprintf(stderr
,"GetBitMapBits32: unknown depth %d, please report.\n",
237 bmp
->bitmap
.bmBitsPixel
239 GDI_HEAP_UNLOCK( hbitmap
);
243 /* Hack: change the bitmap height temporarily to avoid */
244 /* getting unnecessary bitmap rows. */
245 old_height
= bmp
->bitmap
.bmHeight
;
246 bmp
->bitmap
.bmHeight
= height
;
247 image
= (XImage
*)CALL_LARGE_STACK( BITMAP_GetXImage
, bmp
);
248 bmp
->bitmap
.bmHeight
= old_height
;
250 /* copy XImage to 16 bit padded image buffer with real bitsperpixel */
253 switch (bmp
->bitmap
.bmBitsPixel
)
256 for (h
=0;h
<height
;h
++)
259 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
263 *tbuf
|= XGetPixel(image
,w
,h
)<<(7-(w
&7));
264 if ((w
&7) == 7) ++tbuf
;
270 for (h
=0;h
<height
;h
++)
272 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
274 if (!(w
& 1)) *tbuf
= XGetPixel( image
, w
, h
) << 4;
275 else *tbuf
++ |= XGetPixel( image
, w
, h
) & 0x0f;
281 for (h
=0;h
<height
;h
++)
283 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
284 *tbuf
++ = XGetPixel(image
,w
,h
);
290 for (h
=0;h
<height
;h
++)
292 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
294 long pixel
= XGetPixel(image
,w
,h
);
296 *tbuf
++ = pixel
& 0xff;
297 *tbuf
++ = (pixel
>>8) & 0xff;
302 for (h
=0;h
<height
;h
++)
304 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
306 long pixel
= XGetPixel(image
,w
,h
);
308 *tbuf
++ = pixel
& 0xff;
309 *tbuf
++ = (pixel
>> 8) & 0xff;
310 *tbuf
++ = (pixel
>>16) & 0xff;
315 XDestroyImage( image
);
316 GDI_HEAP_UNLOCK( hbitmap
);
317 return height
* bmp
->bitmap
.bmWidthBytes
;
321 /***********************************************************************
322 * SetBitmapBits16 (GDI.106)
324 LONG WINAPI
SetBitmapBits16( HBITMAP16 hbitmap
, LONG count
, LPCVOID buffer
)
326 return SetBitmapBits32( hbitmap
, count
, buffer
);
330 /***********************************************************************
331 * SetBitmapBits32 (GDI32.303)
333 LONG WINAPI
SetBitmapBits32( HBITMAP32 hbitmap
, LONG count
, LPCVOID buffer
)
335 struct XPutImage_descr descr
;
339 LPBYTE sbuf
,tmpbuffer
;
340 int w
,h
,pad
,widthbytes
;
344 fprintf(stderr
, "Negative number of bytes (%ld) passed to SetBitmapBits???\n", count
);
347 bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
350 dprintf_bitmap(stddeb
, "SetBitmapBits: %dx%d %d colors %p\n",
351 bmp
->bitmap
.bmWidth
, bmp
->bitmap
.bmHeight
,
352 1 << bmp
->bitmap
.bmBitsPixel
, buffer
);
354 /* Only set entire lines */
355 height
= count
/ bmp
->bitmap
.bmWidthBytes
;
356 if (height
> bmp
->bitmap
.bmHeight
) height
= bmp
->bitmap
.bmHeight
;
359 GDI_HEAP_UNLOCK( hbitmap
);
363 switch (bmp
->bitmap
.bmBitsPixel
) {
365 if (!(bmp
->bitmap
.bmWidth
& 15))
368 pad
= ((16 - (bmp
->bitmap
.bmWidth
& 15)) + 7) / 8;
371 if (!(bmp
->bitmap
.bmWidth
& 3))
374 pad
= ((4 - (bmp
->bitmap
.bmWidth
& 3)) + 1) / 2;
377 pad
= (2 - (bmp
->bitmap
.bmWidth
& 1)) & 1;
381 pad
= 0; /* we have 16bit alignment already */
384 pad
= (bmp
->bitmap
.bmWidth
*3) & 1;
387 fprintf(stderr
,"SetBitMapBits32: unknown depth %d, please report.\n",
388 bmp
->bitmap
.bmBitsPixel
392 sbuf
= (LPBYTE
)buffer
;
394 widthbytes
= DIB_GetXImageWidthBytes(bmp
->bitmap
.bmWidth
,bmp
->bitmap
.bmBitsPixel
);
395 tmpbuffer
= (LPBYTE
)xmalloc(widthbytes
*height
);
396 image
= XCreateImage( display
, DefaultVisualOfScreen(screen
),
397 bmp
->bitmap
.bmBitsPixel
, ZPixmap
, 0, tmpbuffer
,
398 bmp
->bitmap
.bmWidth
,height
,32,widthbytes
401 /* copy 16 bit padded image buffer with real bitsperpixel to XImage */
402 sbuf
= (LPBYTE
)buffer
;
403 switch (bmp
->bitmap
.bmBitsPixel
)
406 for (h
=0;h
<height
;h
++)
408 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
410 XPutPixel(image
,w
,h
,(sbuf
[0]>>(7-(w
&7))) & 1);
418 for (h
=0;h
<height
;h
++)
420 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
422 if (!(w
& 1)) XPutPixel( image
, w
, h
, *sbuf
>> 4 );
423 else XPutPixel( image
, w
, h
, *sbuf
++ & 0xf );
429 for (h
=0;h
<height
;h
++)
431 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
432 XPutPixel(image
,w
,h
,*sbuf
++);
438 for (h
=0;h
<height
;h
++)
440 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
442 XPutPixel(image
,w
,h
,sbuf
[1]*256+sbuf
[0]);
448 for (h
=0;h
<height
;h
++)
450 for (w
=0;w
<bmp
->bitmap
.bmWidth
;w
++)
452 XPutPixel(image
,w
,h
,(sbuf
[2]<<16)+(sbuf
[1]<<8)+sbuf
[0]);
462 descr
.width
= bmp
->bitmap
.bmWidth
;
463 descr
.height
= height
;
464 CALL_LARGE_STACK( XPutImage_wrapper
, &descr
);
466 XDestroyImage( image
); /* frees tmpbuffer too */
467 GDI_HEAP_UNLOCK( hbitmap
);
468 return height
* bmp
->bitmap
.bmWidthBytes
;
471 /**********************************************************************
472 * LoadImageA (USER32.364)
473 * FIXME: implementation still lacks nearly all features, see LR_*
474 * defines in windows.h
477 HANDLE32 WINAPI
LoadImage32A( HINSTANCE32 hinst
, LPCSTR name
, UINT32 type
,
478 INT32 desiredx
, INT32 desiredy
, UINT32 loadflags
)
481 dprintf_resource(stddeb
,"LoadImage32A(0x%04x,%s,%d,%d,%d,0x%08x)\n",
482 hinst
,name
,type
,desiredx
,desiredy
,loadflags
485 dprintf_resource(stddeb
,"LoadImage32A(0x%04x,%p,%d,%d,%d,0x%08x)\n",
486 hinst
,name
,type
,desiredx
,desiredy
,loadflags
491 return LoadBitmap32A(hinst
,name
);
493 return LoadIcon32A(hinst
,name
);
495 return LoadCursor32A(hinst
,name
);
500 /**********************************************************************
501 * CopyImage32 (USER32.60)
503 * FIXME: implementation still lacks nearly all features, see LR_*
504 * defines in windows.h
506 HANDLE32 WINAPI
CopyImage32( HANDLE32 hnd
, UINT32 type
, INT32 desiredx
,
507 INT32 desiredy
, UINT32 flags
)
512 return hnd
; /* FIXME ... need to copy here */
514 return CopyIcon32(hnd
);
516 return CopyCursor32(hnd
);
522 /**********************************************************************
523 * LoadBitmap16 (USER.175)
525 HBITMAP16 WINAPI
LoadBitmap16( HINSTANCE16 instance
, SEGPTR name
)
527 HBITMAP32 hbitmap
= 0;
535 char *str
= (char *)PTR_SEG_TO_LIN( name
);
536 dprintf_bitmap( stddeb
, "LoadBitmap16(%04x,'%s')\n", instance
, str
);
537 if (str
[0] == '#') name
= (SEGPTR
)(DWORD
)(WORD
)atoi( str
+ 1 );
540 dprintf_bitmap( stddeb
, "LoadBitmap16(%04x,%04x)\n",
541 instance
, LOWORD(name
) );
543 if (!instance
) /* OEM bitmap */
545 if (HIWORD((int)name
)) return 0;
546 return OBM_LoadBitmap( LOWORD((int)name
) );
549 if (!(hRsrc
= FindResource16( instance
, name
, RT_BITMAP
))) return 0;
550 if (!(handle
= LoadResource16( instance
, hRsrc
))) return 0;
552 info
= (BITMAPINFO
*)LockResource16( handle
);
553 if ((hdc
= GetDC32(0)) != 0)
555 char *bits
= (char *)info
+ DIB_BitmapInfoSize( info
, DIB_RGB_COLORS
);
556 hbitmap
= CreateDIBitmap32( hdc
, &info
->bmiHeader
, CBM_INIT
,
557 bits
, info
, DIB_RGB_COLORS
);
558 ReleaseDC32( 0, hdc
);
560 FreeResource16( handle
);
564 /**********************************************************************
565 * LoadBitmap32W (USER32.357)
567 HBITMAP32 WINAPI
LoadBitmap32W( HINSTANCE32 instance
, LPCWSTR name
)
569 HBITMAP32 hbitmap
= 0;
575 if (!instance
) /* OEM bitmap */
577 if (HIWORD((int)name
)) return 0;
578 return OBM_LoadBitmap( LOWORD((int)name
) );
581 if (!(hRsrc
= FindResource32W( instance
, name
,
582 (LPWSTR
)RT_BITMAP
))) return 0;
583 if (!(handle
= LoadResource32( instance
, hRsrc
))) return 0;
585 info
= (BITMAPINFO
*)LockResource32( handle
);
586 if ((hdc
= GetDC32(0)) != 0)
588 char *bits
= (char *)info
+ DIB_BitmapInfoSize( info
, DIB_RGB_COLORS
);
589 hbitmap
= CreateDIBitmap32( hdc
, &info
->bmiHeader
, CBM_INIT
,
590 bits
, info
, DIB_RGB_COLORS
);
591 ReleaseDC32( 0, hdc
);
597 /**********************************************************************
598 * LoadBitmap32A (USER32.356)
600 HBITMAP32 WINAPI
LoadBitmap32A( HINSTANCE32 instance
, LPCSTR name
)
603 if (!HIWORD(name
)) res
= LoadBitmap32W( instance
, (LPWSTR
)name
);
606 LPWSTR uni
= HEAP_strdupAtoW( GetProcessHeap(), 0, name
);
607 res
= LoadBitmap32W( instance
, uni
);
608 HeapFree( GetProcessHeap(), 0, uni
);
614 /***********************************************************************
615 * BITMAP_DeleteObject
617 BOOL32
BITMAP_DeleteObject( HBITMAP16 hbitmap
, BITMAPOBJ
* bmp
)
619 #ifdef PRELIMINARY_WING16_SUPPORT
620 if( bmp
->bitmap
.bmBits
)
621 XShmDetach( display
, (XShmSegmentInfo
*)bmp
->bitmap
.bmBits
);
624 XFreePixmap( display
, bmp
->pixmap
);
625 #ifdef PRELIMINARY_WING16_SUPPORT
626 if( bmp
->bitmap
.bmBits
)
628 __ShmBitmapCtl
* p
= (__ShmBitmapCtl
*)bmp
->bitmap
.bmBits
;
629 WORD sel
= HIWORD(p
->bits
);
630 unsigned long l
, limit
= GetSelectorLimit(sel
);
632 for( l
= 0; l
< limit
; l
+= 0x10000, sel
+= __AHINCR
)
634 shmctl(p
->si
.shmid
, IPC_RMID
, NULL
);
635 shmdt(p
->si
.shmaddr
); /* already marked for destruction */
638 return GDI_FreeObject( hbitmap
);
642 /***********************************************************************
645 INT16
BITMAP_GetObject16( BITMAPOBJ
* bmp
, INT16 count
, LPVOID buffer
)
647 if (count
> sizeof(bmp
->bitmap
)) count
= sizeof(bmp
->bitmap
);
648 memcpy( buffer
, &bmp
->bitmap
, count
);
653 /***********************************************************************
656 INT32
BITMAP_GetObject32( BITMAPOBJ
* bmp
, INT32 count
, LPVOID buffer
)
659 bmp32
.bmType
= bmp
->bitmap
.bmType
;
660 bmp32
.bmWidth
= bmp
->bitmap
.bmWidth
;
661 bmp32
.bmHeight
= bmp
->bitmap
.bmHeight
;
662 bmp32
.bmWidthBytes
= bmp
->bitmap
.bmWidthBytes
;
663 bmp32
.bmPlanes
= bmp
->bitmap
.bmPlanes
;
664 bmp32
.bmBitsPixel
= bmp
->bitmap
.bmBitsPixel
;
666 if (count
> sizeof(bmp32
)) count
= sizeof(bmp32
);
667 memcpy( buffer
, &bmp32
, count
);
673 /***********************************************************************
674 * CreateDiscardableBitmap16 (GDI.156)
676 HBITMAP16 WINAPI
CreateDiscardableBitmap16( HDC16 hdc
, INT16 width
,
679 return CreateCompatibleBitmap16( hdc
, width
, height
);
683 /***********************************************************************
684 * CreateDiscardableBitmap32 (GDI32.38)
686 HBITMAP32 WINAPI
CreateDiscardableBitmap32( HDC32 hdc
, INT32 width
,
689 return CreateCompatibleBitmap32( hdc
, width
, height
);
693 /***********************************************************************
694 * GetBitmapDimensionEx16 (GDI.468)
696 BOOL16 WINAPI
GetBitmapDimensionEx16( HBITMAP16 hbitmap
, LPSIZE16 size
)
698 BITMAPOBJ
* bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
699 if (!bmp
) return FALSE
;
701 GDI_HEAP_UNLOCK( hbitmap
);
706 /***********************************************************************
707 * GetBitmapDimensionEx32 (GDI32.144)
709 BOOL32 WINAPI
GetBitmapDimensionEx32( HBITMAP32 hbitmap
, LPSIZE32 size
)
711 BITMAPOBJ
* bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
712 if (!bmp
) return FALSE
;
713 size
->cx
= (INT32
)bmp
->size
.cx
;
714 size
->cy
= (INT32
)bmp
->size
.cy
;
715 GDI_HEAP_UNLOCK( hbitmap
);
720 /***********************************************************************
721 * GetBitmapDimension (GDI.162)
723 DWORD WINAPI
GetBitmapDimension( HBITMAP16 hbitmap
)
726 if (!GetBitmapDimensionEx16( hbitmap
, &size
)) return 0;
727 return MAKELONG( size
.cx
, size
.cy
);
731 /***********************************************************************
732 * SetBitmapDimensionEx16 (GDI.478)
734 BOOL16 WINAPI
SetBitmapDimensionEx16( HBITMAP16 hbitmap
, INT16 x
, INT16 y
,
737 BITMAPOBJ
* bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
738 if (!bmp
) return FALSE
;
739 if (prevSize
) *prevSize
= bmp
->size
;
742 GDI_HEAP_UNLOCK( hbitmap
);
747 /***********************************************************************
748 * SetBitmapDimensionEx32 (GDI32.304)
750 BOOL32 WINAPI
SetBitmapDimensionEx32( HBITMAP32 hbitmap
, INT32 x
, INT32 y
,
753 BITMAPOBJ
* bmp
= (BITMAPOBJ
*) GDI_GetObjPtr( hbitmap
, BITMAP_MAGIC
);
754 if (!bmp
) return FALSE
;
755 if (prevSize
) CONV_SIZE16TO32( &bmp
->size
, prevSize
);
756 bmp
->size
.cx
= (INT16
)x
;
757 bmp
->size
.cy
= (INT16
)y
;
758 GDI_HEAP_UNLOCK( hbitmap
);
763 /***********************************************************************
764 * SetBitmapDimension (GDI.163)
766 DWORD WINAPI
SetBitmapDimension( HBITMAP16 hbitmap
, INT16 x
, INT16 y
)
769 if (!SetBitmapDimensionEx16( hbitmap
, x
, y
, &size
)) return 0;
770 return MAKELONG( size
.cx
, size
.cy
);