KeepPixelDataIntact Example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void TestKeepPixelDataIntact ()
{
   // Load a Data Set string
   strMessage = null;
   if (LEADDICOM1.LoadDS("d:\\lead14\\dist\\images\\dicom\\Image1.dic", 0) == (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
   {
      if (LEADDICOM1.KeepPixelDataIntact == false)
      {
         strMessage = "Would you like to keep the pixel data unchanged?" + System.Environment.NewLine + "   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, string.Empty, MessageBoxButtons.YesNo) == DialogResult.Yes)
            LEADDICOM1.KeepPixelDataIntact = true;
      }
      if (LEADDICOM1.FindFirstElementGetBitmapValue((int)LTDICLib.DicomDataSetTagConstants9.TAG_PIXEL_DATA, false) == (short)LTDicomKernelLib.DicomErrorCodes.DICOM_SUCCESS)
      {
         LEADDICOM1.GetBitmapValue(0, 0, (short)LTDICLib.DicomColorOrderConstants.ORDER_BGR, 0);
         // ...
      }
   }
}