LabelType: doBitmap
We have to admit the term “Bitmap” is a bit confusing for most people. It is actually a DICOM term for “map of bits”, not the common Bitmap graph. What you have for label type Bitmap is a collection of dots, positions of which are specified in the Points property of that label object:
Say you want to create the following logo at the top left hand corner of the viewer using bitmap(/img/kb/DoBitMap2.webp)
DicomObjects.NET version
DicomLabel mylabel = new DicomLabel();
mylabel.LabelType = LabelType.Bitmap;
mylabel.ScaleMode = ScaleMode.Image;
int size, radius;
size = 50;
radius = size / 4;
for (int p = 1; p <= size; p++)
{
mylabel.AddPoint(p, p); // diagonal line
mylabel.AddPoint(p, 0); // top line
mylabel.AddPoint(0, p); // Left hand line
mylabel.AddPoint(size, p); // Right Hand Line
mylabel.AddPoint(p, size); // Bottom line
}
// circle
for (int p = 0; p <= 359; p++)
{
mylabel.AddPoint((float)(radius * Math.Sin(p * Math.PI / 180) + size / 2),
(float)(radius * Math.Cos(p * Math.PI / 180) + size / 2));
}
Viewer.CurrentImage.Labels.Add(mylabel);
DicomObjects.COM version
Dim mylabel As New DicomLabel
mylabel.LabelType = doLabelBitmap
mylabel.ScaleMode = doLabelScaleImage
Dim p As Integer
Dim size As Integer
Dim pi As Double
pi = 3.14159265358979
size = 50
Dim Radius As Integer
Radius = size / 4
For p = 1 To size
'diagonal line
mylabel.AddPoint p, p
'top line
mylabel.AddPoint p, 0
'Left hand line
mylabel.AddPoint 0, p
'Right Hand Line
mylabel.AddPoint size, p
'Bottom line
mylabel.AddPoint p, size
Next
'circle
For p = 0 To 359
mylabel.AddPoint Radius * Sin(p * pi / 180) + size / 2, Radius * Cos(p * pi / 180) + size / 2
Next