The SURFOBJ structure is the user object for a surface. A device driver usually calls methods on a surface object only when the surface object represents a GDI bitmap or a device-managed surface.
typedef struct _SURFOBJ {
DHSURF dhsurf;
HSURF hsurf;
DHPDEV dhpdev;
HDEV hdev;
SIZEL sizlBitmap;
ULONG cjBits;
PVOID pvBits;
PVOID pvScan0;
LONG lDelta;
ULONG iUniq;
ULONG iBitmapFormat;
USHORT iType;
USHORT fjBitmap;
} SURFOBJ;
For a surface that should not be cached, iUniq is set to zero. This value is used in conjunction with the BMF_DONTCACHE flag of fjBitmap.
| Value | Meaning |
|---|---|
| BMF_1BPP | 1 bit per pixel. |
| BMF_4BPP | 4 bits per pixel. |
| BMF_8BPP | 8 bits per pixel. |
| BMF_16BPP | 16 bits per pixel. |
| BMF_24BPP | 24 bits per pixel. |
| BMF_32BPP | 32 bits per pixel. |
| BMF_4RLE | 4 bits per pixel, run length encoded. |
| BMF_8RLE | 8 bits per pixel, run length encoded. |
| BMF_JPEG | JPEG compressed image. |
| BMF_PNG | PNG compressed image. |
| Type | Definition |
|---|---|
| STYPE_BITMAP | The surface is a bitmap. |
| STYPE_DEVBITMAP | The surface is a device format bitmap. |
| STYPE_DEVICE | The surface is managed by the device. |
| Value | Meaning |
|---|---|
| BMF_DONTCACHE | The bitmap should not be cached by the driver because it is a transient bitmap, created by GDI, that the driver will never see again. If this flag is set, the iUniq member of this structure will be set to 0. |
| BMF_KMSECTION | Is used by GDI only and should be ignored by the driver. |
| BMF_NOTSYSMEM | The bitmap is not in system memory. EngModifySurface sets this flag when it moves a bitmap into video memory. |
| BMF_NOZEROINIT | The bitmap was not zero-initialized. |
| BMF_TOPDOWN | The first scan line represents the top of the bitmap. |
| BMF_WINDOW_BLT | GDI sets this flag to notify the driver of a window move from one screen location to another. |
Declared in winddi.h. Include winddi.h.
When information about a particular surface is required by a driver, the driver must access the SURFOBJ. This structure allows quick access to the properties of the surface.
When a SURFOBJ structure represents a GDI bitmap, the driver must be able to determine the format of the bitmap and locate the bitmap bits.
When a SURFOBJ structure represents a device surface, the driver must be able to locate the device handle for the surface.
For more information about supporting JPEG and PNG compressed images, see DEVINFO.