This class describes the image data expected by the custom paint callbacks. It is used with the RasterPaintCallbacks callbacks.
public class RasterPaintDibInfoPublic Class RasterPaintDibInfopublic ref class RasterPaintDibInfoThe user will typically allocate this class and return it from the RasterImagePaintCallbackFunction.GetDibInfoCallback callback.
This example will show how to indicate that the graphics device expects a 16-bit image with the image data in the low 12 bits. Also, this particular card expected the data to be top-down, unlike the usual GDI functions which expect the data to be upside-down.
The example is in C++/CLI because this is the most useful language for implementing these classes.
// macro that calculates the number of bytes per line, rounding up to a multiple of 4 bytes#define DIB_WIDTH_BYTES(pixels) ((((pixels) + 31) & ~31) >> 3)Object^ myPaintCallbacks::GetDibInfoCallback(RasterImage^ image, array<Object^>^ args){// make sure the parameters are correctif(args->Length != 2 || image == nullptr){throw gcnew RasterException(RasterExceptionCode::InvalidParameter);return nullptr;}UInt32 uWidth = (UInt32)args[1];RasterPaintDibInfo^ pDibInfo = gcnew RasterPaintDibInfo;if(pDibInfo == nullptr){throw gcnew RasterException(RasterExceptionCode::NoMemory);return nullptr;}pDibInfo->Default();pDibInfo->BitsPerPixel = 16; // paint using 16-bit data, although there are only 12 significant bitspDibInfo->PlaneCount = 1; // One planepDibInfo->BytesPerLine = DIB_WIDTH_BYTES(uWidth * 16); // bytes per line is a multiple of 4 bytespDibInfo->ViewPerspective = RasterViewPerspective::TopLeft; // the data should be TOP_LEFT, not BOTTOM_LEFT like the data in the regular GDI functionspDibInfo->Order = RasterByteOrder::Gray; // gray bitmap// indicate that the data should be in the low 12 bitspDibInfo->Flags = RasterPaintDibInfoFlags::LowHighBitValid;pDibInfo->LowBit = 0;pDibInfo->HighBit = 11;return pDibInfo;}
|
Products |
Support |
Feedback: RasterPaintDibInfo Class - Leadtools.Drawing |
Introduction |
Help Version 19.0.2017.3.21
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.