REAL height, GpTexture **texture)
{
HDC hdc;
- OLE_HANDLE hbm;
- HBITMAP old = NULL;
+ HBITMAP hbm, old = NULL;
BITMAPINFO *pbmi;
BITMAPINFOHEADER *bmih;
INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp;
n_y + n_height > ((GpBitmap*)image)->height)
return InvalidParameter;
- IPicture_get_Handle(image->picture, &hbm);
+ IPicture_get_Handle(image->picture, (OLE_HANDLE*)&hbm);
if(!hbm) return GenericError;
IPicture_get_CurDC(image->picture, &hdc);
bm_is_selected = (hdc != 0);
if(!bm_is_selected){
hdc = CreateCompatibleDC(0);
- old = SelectObject(hdc, (HBITMAP)hbm);
+ old = SelectObject(hdc, hbm);
}
/* fill out bmi */
- GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
bytespp = pbmi->bmiHeader.biBitCount / 8;
abs_height = abs(pbmi->bmiHeader.biHeight);
dibits = GdipAlloc(pbmi->bmiHeader.biSizeImage);
if(dibits) /* this is not a good place to error out */
- GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS);
if(!bm_is_selected){
SelectObject(hdc, old);
{
BOOL bm_is_selected;
INT stride, bitspp = PIXELFORMATBPP(format);
- OLE_HANDLE hbm;
HDC hdc;
- HBITMAP old = NULL;
+ HBITMAP hbm, old = NULL;
BITMAPINFO *pbmi;
BYTE *buff = NULL;
UINT abs_height;
if(bitmap->lockmode)
return WrongState;
- IPicture_get_Handle(bitmap->image.picture, &hbm);
+ IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm);
IPicture_get_CurDC(bitmap->image.picture, &hdc);
bm_is_selected = (hdc != 0);
if(!bm_is_selected){
hdc = CreateCompatibleDC(0);
- old = SelectObject(hdc, (HBITMAP)hbm);
+ old = SelectObject(hdc, hbm);
}
/* fill out bmi */
- GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
abs_height = abs(pbmi->bmiHeader.biHeight);
stride = pbmi->bmiHeader.biWidth * bitspp / 8;
pbmi->bmiHeader.biBitCount = bitspp;
if(buff)
- GetDIBits(hdc, (HBITMAP)hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, abs_height, buff, pbmi, DIB_RGB_COLORS);
if(!bm_is_selected){
SelectObject(hdc, old);
GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
BitmapData* lockeddata)
{
- OLE_HANDLE hbm;
HDC hdc;
- HBITMAP old = NULL;
+ HBITMAP hbm, old = NULL;
BOOL bm_is_selected;
BITMAPINFO *pbmi;
return Ok;
}
- IPicture_get_Handle(bitmap->image.picture, &hbm);
+ IPicture_get_Handle(bitmap->image.picture, (OLE_HANDLE*)&hbm);
IPicture_get_CurDC(bitmap->image.picture, &hdc);
bm_is_selected = (hdc != 0);
if(!bm_is_selected){
hdc = CreateCompatibleDC(0);
- old = SelectObject(hdc, (HBITMAP)hbm);
+ old = SelectObject(hdc, hbm);
}
- GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
pbmi->bmiHeader.biBitCount = PIXELFORMATBPP(lockeddata->PixelFormat);
- SetDIBits(hdc, (HBITMAP)hbm, 0, abs(pbmi->bmiHeader.biHeight),
+ SetDIBits(hdc, hbm, 0, abs(pbmi->bmiHeader.biHeight),
bitmap->bitmapbits, pbmi, DIB_RGB_COLORS);
if(!bm_is_selected){
if(type == PICTYPE_BITMAP){
BITMAPINFO *pbmi;
BITMAPCOREHEADER* bmch;
- OLE_HANDLE hbm;
+ HBITMAP hbm;
HDC hdc;
pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
(*((GpBitmap**) image))->height = ipicture_pixel_height(pic);
/* get the pixel format */
- IPicture_get_Handle(pic, &hbm);
+ IPicture_get_Handle(pic, (OLE_HANDLE*)&hbm);
IPicture_get_CurDC(pic, &hdc);
bmch = (BITMAPCOREHEADER*) (&pbmi->bmiHeader);
if(!hdc){
HBITMAP old;
hdc = CreateCompatibleDC(0);
- old = SelectObject(hdc, (HBITMAP)hbm);
- GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+ old = SelectObject(hdc, hbm);
+ GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
SelectObject(hdc, old);
DeleteDC(hdc);
}
else
- GetDIBits(hdc, (HBITMAP)hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
+ GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
(*((GpBitmap**) image))->format = (bmch->bcBitCount << 8) | PixelFormatGDI;
GdipFree(pbmi);