gdiplus: Partial implementation of GdipCreateBitmapFromGdiDib.
This commit is contained in:
parent
fc1a1f66ee
commit
b2ebf709ff
|
@ -73,7 +73,7 @@
|
|||
@ stub GdipCreateBitmapFromDirectDrawSurface
|
||||
@ stdcall GdipCreateBitmapFromFile(wstr ptr)
|
||||
@ stdcall GdipCreateBitmapFromFileICM(wstr ptr)
|
||||
@ stub GdipCreateBitmapFromGdiDib
|
||||
@ stdcall GdipCreateBitmapFromGdiDib(ptr ptr ptr)
|
||||
@ stdcall GdipCreateBitmapFromGraphics(long long ptr ptr)
|
||||
@ stdcall GdipCreateBitmapFromHBITMAP(long long ptr)
|
||||
@ stub GdipCreateBitmapFromHICON
|
||||
|
|
|
@ -270,6 +270,47 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename,
|
|||
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 */
|
||||
GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename,
|
||||
GpBitmap **bitmap)
|
||||
|
|
|
@ -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 GdipCreateBitmapFromFile(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 GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*,
|
||||
GpBitmap**);
|
||||
|
|
Loading…
Reference in New Issue