comparison dwt/graphics/Image.d @ 237:e2affbeb686d

Making tango.sys.win32.Types and dwt.internal.win32.WINTYPES to match common declaration. Make ansi charactars of type ubyte.
author Frank Benoit <benoit@tionex.de>
date Thu, 19 Jun 2008 03:25:36 +0200
parents 36f5cb12e1a2
children fd9c62a2998e
comparison
equal deleted inserted replaced
236:9c1bb90eba13 237:e2affbeb686d
1419 } 1419 }
1420 /* Calculate number of colors */ 1420 /* Calculate number of colors */
1421 int numColors = 0; 1421 int numColors = 0;
1422 if (depth <= 8) { 1422 if (depth <= 8) {
1423 if (isDib) { 1423 if (isDib) {
1424 numColors = dib.biClrUsed; 1424 numColors = dib.dsBmih.biClrUsed;
1425 } else { 1425 } else {
1426 numColors = 1 << depth; 1426 numColors = 1 << depth;
1427 } 1427 }
1428 } 1428 }
1429 /* Create the BITMAPINFO */ 1429 /* Create the BITMAPINFO */
1453 } 1453 }
1454 } 1454 }
1455 /* Find the size of the image and allocate data */ 1455 /* Find the size of the image and allocate data */
1456 int imageSize; 1456 int imageSize;
1457 if (isDib) { 1457 if (isDib) {
1458 imageSize = dib.biSizeImage; 1458 imageSize = dib.dsBmih.biSizeImage;
1459 } else { 1459 } else {
1460 /* Call with null lpBits to get the image size */ 1460 /* Call with null lpBits to get the image size */
1461 static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED); 1461 static if (OS.IsWinCE) DWT.error(DWT.ERROR_NOT_IMPLEMENTED);
1462 OS.GetDIBits(hBitmapDC, handle, 0, height, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS); 1462 OS.GetDIBits(hBitmapDC, handle, 0, height, null, cast(BITMAPINFO*)bmi.ptr, OS.DIB_RGB_COLORS);
1463 OS.MoveMemory(&bmiHeader, bmi.ptr, BITMAPINFOHEADER.sizeof); 1463 OS.MoveMemory(&bmiHeader, bmi.ptr, BITMAPINFOHEADER.sizeof);
1467 /* Get the bitmap data */ 1467 /* Get the bitmap data */
1468 if (isDib) { 1468 if (isDib) {
1469 if (OS.IsWinCE) { 1469 if (OS.IsWinCE) {
1470 if (this.handle !is handle) { 1470 if (this.handle !is handle) {
1471 /* get image data from the temporary DIB */ 1471 /* get image data from the temporary DIB */
1472 OS.MoveMemory(data.ptr, dib.bmBits, imageSize); 1472 OS.MoveMemory(data.ptr, dib.dsBm.bmBits, imageSize);
1473 } 1473 }
1474 } else { 1474 } else {
1475 OS.MoveMemory(data.ptr, bm.bmBits, imageSize); 1475 OS.MoveMemory(data.ptr, bm.bmBits, imageSize);
1476 } 1476 }
1477 } else { 1477 } else {