Beispiel #1
0
 private void FillProperty(uint entryID, uint entryType, byte[] entryData)
 {
   switch ((PropertyTagId) entryID)
   {
     case PropertyTagId.EquipMake: _equipMake = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.EquipModel: _equipModel = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ImageDescription: _imageDescription = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.Copyright: _copyright = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifDTOrig: _dtOrig = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifDTDigitized: _dtDigitized = (string) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifFocalLength: _focalLength = (Fraction) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifFNumber: _fNumber = (Fraction) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifExposureBias: _exposureBias = (Fraction) PropertyTag.getValue(entryType, entryData);
       break;
     case PropertyTagId.ExifExposureTime:
       {
         _exposureTime = (Fraction) PropertyTag.getValue(entryType, entryData);
         if (_exposureTime.Numerator > 1)
         {
           _exposureTime.Denumerator /= _exposureTime.Numerator;
           _exposureTime.Numerator /= _exposureTime.Numerator;
         }
       }
       break;
     case PropertyTagId.ExifISOSpeed:
       {
         object tmpValue = PropertyTag.getValue(entryType, entryData);
         _isoSpeed = tmpValue is UInt16 ? ((ushort) tmpValue).ToString() : ((uint) tmpValue).ToString();
       }
       break;
     case PropertyTagId.Orientation:
       {
         object tmpValue = PropertyTag.getValue(entryType, entryData);
         _orientation = tmpValue is UInt16 ? (ushort) tmpValue : (uint) tmpValue;
       }
       break;
     case PropertyTagId.ExifPixXDim:
       {
         object tmpValue = PropertyTag.getValue(entryType, entryData);
         _pixXDim = tmpValue is UInt16 ? (ushort) tmpValue : (uint) tmpValue;
       }
       break;
     case PropertyTagId.ExifPixYDim:
       {
         object tmpValue = PropertyTag.getValue(entryType, entryData);
         _pixYDim = tmpValue is UInt16 ? (ushort) tmpValue : (uint) tmpValue;
       }
       break;
     case PropertyTagId.ExifFlash:
       {
         //object tmpValue = PropertyTag.getValue(EntryType, EntryData);
         uint tmpValue = BitConverter.ToUInt16(entryData, 0);
         if ((tmpValue & 0x1) == 1)
         {
           _flashFired = true;
           FillFlashModeResult(tmpValue);
         }
         else
         {
           _flashFired = false;
           FillFlashModeResult(tmpValue);
         }
       }
       break;
     case PropertyTagId.ExifMeteringMode:
       {
         object tmpValue = PropertyTag.getValue(entryType, entryData);
         _meteringMode = tmpValue is UInt16 ? (MeteringMode) (ushort) tmpValue : (MeteringMode) (uint) tmpValue;
       }
       break;
   }
 }
        private void FillProperty(uint entryID, uint entryType, byte[] entryData)
        {
            switch ((PropertyTagId)entryID)
            {
            case PropertyTagId.EquipMake: _equipMake = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.EquipModel: _equipModel = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ImageDescription: _imageDescription = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.Copyright: _copyright = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifDTOrig: _dtOrig = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifDTDigitized: _dtDigitized = (string)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifFocalLength: _focalLength = (Fraction)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifFNumber: _fNumber = (Fraction)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifExposureBias: _exposureBias = (Fraction)PropertyTag.getValue(entryType, entryData);
                break;

            case PropertyTagId.ExifExposureTime:
            {
                _exposureTime = (Fraction)PropertyTag.getValue(entryType, entryData);
                if (_exposureTime.Numerator > 1)
                {
                    _exposureTime.Denumerator /= _exposureTime.Numerator;
                    _exposureTime.Numerator   /= _exposureTime.Numerator;
                }
            }
            break;

            case PropertyTagId.ExifISOSpeed:
            {
                object tmpValue = PropertyTag.getValue(entryType, entryData);
                _isoSpeed = tmpValue is UInt16 ? ((ushort)tmpValue).ToString() : ((uint)tmpValue).ToString();
            }
            break;

            case PropertyTagId.Orientation:
            {
                object tmpValue = PropertyTag.getValue(entryType, entryData);
                _orientation = tmpValue is UInt16 ? (ushort)tmpValue : (uint)tmpValue;
            }
            break;

            case PropertyTagId.ExifPixXDim:
            {
                object tmpValue = PropertyTag.getValue(entryType, entryData);
                _pixXDim = tmpValue is UInt16 ? (ushort)tmpValue : (uint)tmpValue;
            }
            break;

            case PropertyTagId.ExifPixYDim:
            {
                object tmpValue = PropertyTag.getValue(entryType, entryData);
                _pixYDim = tmpValue is UInt16 ? (ushort)tmpValue : (uint)tmpValue;
            }
            break;

            case PropertyTagId.ExifFlash:
            {
                //object tmpValue = PropertyTag.getValue(EntryType, EntryData);
                uint tmpValue = BitConverter.ToUInt16(entryData, 0);
                if ((tmpValue & 0x1) == 1)
                {
                    _flashFired = true;
                    FillFlashModeResult(tmpValue);
                }
                else
                {
                    _flashFired = false;
                    FillFlashModeResult(tmpValue);
                }
            }
            break;

            case PropertyTagId.ExifMeteringMode:
            {
                object tmpValue = PropertyTag.getValue(entryType, entryData);
                _meteringMode = tmpValue is UInt16 ? (MeteringMode)(ushort)tmpValue : (MeteringMode)(uint)tmpValue;
            }
            break;
            }
        }