With .NET interoperability it is possible to draw inside a NAV 2013 BLOB field. Consider the following snippet of code. “Picture Blob” is a BLOB field. We create a OutStream so we can write information into the blob. We must calc a BLOB field, even if its empty before getting the OutStream.
GenerateBitmap is a function that does the following:
- Creates a Bitmap instance (Size 50×50)
- Creates a Graphics instance on the bitmap
- Creates a SolidBrush in a specific color, in this case from a HTML color code.
- Draws an filled ellipse on the graphics in 0,0 -> 49,49 (bitmaps are 0-indexed)
- Saves the bitmap on the OutStream from our BLOB field.
All variables can be found in the System.Drawing Assembly.
This could be extended so we can draw on a existing BLOB field. So instead of creating a new Bitmap instance, we load the bitmap from an InStream.
And still saves to the OutStream. So you just have to create both the InStream and the OutStream from a BLOB.