I am getting some progress on this,

I am now able to create a blank bitmap with the size that I want (ie. 100x100) using the combination of CreateCompatibleDC and CreateCompatibleBitmap (see msdn for help).

This code initializes the DeviceContext and creates a bitmap with the size of 100 x 100 then attaches a graphics object to the DC as an interface for me to draw more things on it.
Code:
  Move (GetDC(hoWindow)) to hDC
    Move (CreateCompatibleDC(hDC)) to hoMemDC
    Move (CreateCompatibleBitmap(hDC, iThumbnailSize, iThumbnailSize)) to hoMemBitmap
    Move (SelectObject(hoMemDC, hoMemBitmap)) to hDCObject
    
    // Initialize graphics component so that we can draw on the bitmap
    Get Create (RefClass(cGDIGraphics)) to hoGraphics
    Get AttachDC of hoGraphics hoMemDC to iResult
    
    // Create brush for drawing
    Get Create (RefClass(cGDISolidBrush)) to hoBrush
    Move (ARGB (255 , R_From_RGB (clWhite), G_From_RGB (clWhite), B_From_RGB (clWhite))) to iColor // white brush, with alpha channel to full
    Get CreateSolidBrush of hoBrush iColor to iResult
    If (iResult=gpOk) Begin
      // Fill Graphics
      Get FillRectangle of hoGraphics hoBrush 0 0 iThumbnailSize iThumbnailSize to iResult
    End
I would like to know if anybody knows how to read the DeviceContext data as a pointer that is compatible with the cGDIImage (essentially reading the DC as an image). Or at least use one of the functions defined inside the cGDIImage.pkg class to set the ppImage pointer property of the cGDIImage so that I can use it to properly encode the correct file type using the SaveImageToFile procedure from cImageContainer.pkg..

Right now, we are reading this DeviceContext block and then saving it to disk as a bmp file and then re-reading it in using the CreateImageFromFile of cGDIImage to populate the ppImage pointer. We then use this pointer to save an encoded version of the file type that we are after this feels like its an unecessary step.

Maybe a good starting routine to use is the CreateImageFromStream from cGDIImage.pkg class and pass in a pointer to the DeviceContext with the virtual bitmap but I cannot get my head around this.

Regards,
Rol