Commit b2ebf709 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

gdiplus: Partial implementation of GdipCreateBitmapFromGdiDib.

parent fc1a1f66
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
@ stub GdipCreateBitmapFromDirectDrawSurface @ stub GdipCreateBitmapFromDirectDrawSurface
@ stdcall GdipCreateBitmapFromFile(wstr ptr) @ stdcall GdipCreateBitmapFromFile(wstr ptr)
@ stdcall GdipCreateBitmapFromFileICM(wstr ptr) @ stdcall GdipCreateBitmapFromFileICM(wstr ptr)
@ stub GdipCreateBitmapFromGdiDib @ stdcall GdipCreateBitmapFromGdiDib(ptr ptr ptr)
@ stdcall GdipCreateBitmapFromGraphics(long long ptr ptr) @ stdcall GdipCreateBitmapFromGraphics(long long ptr ptr)
@ stdcall GdipCreateBitmapFromHBITMAP(long long ptr) @ stdcall GdipCreateBitmapFromHBITMAP(long long ptr)
@ stub GdipCreateBitmapFromHICON @ stub GdipCreateBitmapFromHICON
......
...@@ -270,6 +270,47 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, ...@@ -270,6 +270,47 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
return stat; return stat;
} }
GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* info,
VOID *bits, GpBitmap **bitmap)
{
DWORD height, stride;
PixelFormat format;
FIXME("(%p, %p, %p) - partially implemented\n", info, bits, bitmap);
height = abs(info->bmiHeader.biHeight);
stride = ((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) >> 3) & ~3;
if(info->bmiHeader.biHeight > 0) /* bottom-up */
{
bits = (BYTE*)bits + (height - 1) * stride;
stride = -stride;
}
switch(info->bmiHeader.biBitCount) {
case 1:
format = PixelFormat1bppIndexed;
break;
case 4:
format = PixelFormat4bppIndexed;
break;
case 8:
format = PixelFormat8bppIndexed;
break;
case 24:
format = PixelFormat24bppRGB;
break;
default:
FIXME("don't know how to handle %d bpp\n", info->bmiHeader.biBitCount);
*bitmap = NULL;
return InvalidParameter;
}
return GdipCreateBitmapFromScan0(info->bmiHeader.biWidth, height, stride, format,
bits, bitmap);
}
/* FIXME: no icm */ /* FIXME: no icm */
GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename, GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename,
GpBitmap **bitmap) GpBitmap **bitmap)
......
...@@ -332,6 +332,7 @@ GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(const GpGraphics*,GpMetafile*,INT ...@@ -332,6 +332,7 @@ GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(const GpGraphics*,GpMetafile*,INT
GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream(const GpGraphics*,GpMetafile*,INT*,IStream*,EmfType,const WCHAR*,GpMetafile**); GpStatus WINGDIPAPI GdipConvertToEmfPlusToStream(const GpGraphics*,GpMetafile*,INT*,IStream*,EmfType,const WCHAR*,GpMetafile**);
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO*,VOID*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT,INT,GpGraphics*,GpBitmap**); GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT,INT,GpGraphics*,GpBitmap**);
GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
GpBitmap**); GpBitmap**);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment