KeepPixelDataIntact Example for Visual Basic

' Load a Data Set
If LEADDICOM1.LoadDS ("d:\lead14\dist\images\dicom\Image1.dic", 0) = DICOM_SUCCESS Then
   If LEADDICOM1.KeepPixelDataIntact = False Then
      Dim strMessage As String
      strMessage = "Would you like to keep the pixel data unchanged?" & _
                   vbCrLf & _
                   "If you choose Yes, then the resulting bitmap data " & _
                   "will represent exactly what appears inside the " & _
                   "DICOM file, but may not display properly. If you " & _
                   "choose No, then the resulting bitmap data may not " & _
                   "be identical to what appears inside the DICOM file, " & _
                   "but will display properly."
      If MsgBox(strMessage, vbYesNo) = vbYes Then
         LEADDICOM1.KeepPixelDataIntact = True
      End If
   End If

   If LEADDICOM1.FindFirstElement (TAG_PIXEL_DATA, False) = DICOM_SUCCESS Then
      LEADDICOM1.GetBitmapValue 0, 0, ORDER_BGR, 0

      ' ...
   End If
End If