KeepPixelDataIntact Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestKeepPixelDataIntact ( )
   ' Load a Data Set
   Dim strMessage As String
   If LEADDICOM1.LoadDS("d:\lead14\dist\images\dicom\Image1.dic", 0) = LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS Then
      If LEADDICOM1.KeepPixelDataIntact = False Then
         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 MessageBox.Show(strMessage, "", MessageBoxButtons.YesNo) = DialogResult.Yes Then
            LEADDICOM1.KeepPixelDataIntact = True
         End If
      End If

      If LEADDICOM1.FindFirstElement(LTDICLib.DicomDataSetTagConstants9.TAG_PIXEL_DATA, False) = LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS Then
         LEADDICOM1.GetBitmapValue(0, 0, LTDICLib.DicomColorOrderConstants.ORDER_BGR, 0)

         ' ...
      End If
   End If
End Sub