powered by simpleCommunicator - 2.0.54     © 2025 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Как в .Net выкапывать свойства и значения из PropertyItems GDI+-совместимого файла?
3 сообщений из 3, страница 1 из 1
Как в .Net выкапывать свойства и значения из PropertyItems GDI+-совместимого файла?
    #38951947
Дмитрий77
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Ну т.е. втыкаться очевидно как-то так:
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
    Dim m_img As Image
    Try
      m_img = Image.FromFile(sFilename)
      GetFileProperties.IsPictureFormat = True
      'PropertyCount = m_img.PropertyItems.Count()
      'Get the PropertyItems property from image. 
      Dim propItems As PropertyItem() = m_img.PropertyItems
      For Each propItem As PropertyItem In propItems
        Debug.Print(propItem.Id & ":" & propItem.Value.ToString) '???????? 
      Next
      m_img.Dispose()

    Catch
      'MsgBox "Not a graphic file!"
    End Try



Нужно что: на основании наличия/значений Image_Property_ID_Tags заполнить свою структуру и проанализировать свойства файла.
Пока плаваю в .Net-терминологии.
На чистом GDI+ это простыня, на всяк. случай приложу ее под спойлером (VB6), чтоб было понятно о чем идет речь:

Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
764.
765.
766.
767.
768.
769.
770.
771.
772.
773.
774.
775.
776.
777.
778.
779.
780.
781.
782.
783.
784.
785.
786.
787.
788.
789.
790.
791.
792.
793.
794.
795.
796.
797.
798.
799.
800.
801.
802.
803.
804.
805.
806.
807.
808.
809.
810.
811.
812.
813.
814.
815.
816.
817.
818.
819.
820.
821.
822.
823.
824.
825.
826.
827.
828.
829.
830.
831.
832.
833.
834.
835.
836.
837.
838.
839.
840.
841.
842.
843.
844.
845.
846.
847.
848.
849.
850.
851.
852.
853.
854.
855.
856.
857.
858.
859.
860.
861.
862.
863.
864.
865.
866.
867.
868.
869.
870.
871.
872.
873.
874.
875.
876.
877.
878.
879.
880.
881.
882.
883.
884.
885.
886.
887.
888.
889.
890.
891.
892.
893.
894.
895.
896.
897.
898.
899.
900.
901.
902.
903.
904.
905.
906.
907.
908.
909.
910.
911.
912.
913.
914.
915.
916.
917.
918.
919.
920.
921.
922.
923.
924.
925.
926.
927.
928.
929.
930.
931.
932.
933.
934.
935.
936.
937.
938.
939.
940.
941.
942.
943.
944.
945.
946.
947.
948.
949.
950.
951.
952.
953.
954.
955.
956.
957.
958.
959.
960.
961.
962.
963.
964.
965.
966.
967.
968.
969.
970.
971.
972.
973.
974.
975.
976.
977.
978.
979.
980.
981.
982.
983.
984.
Public Function GetFileProperties(ByVal sFilename As String) As PictureFileProp
  Dim retStatus As Status
  Dim m_img As Long
  Dim PropertyCount As Long
  Dim prop As GDIPPropertyItem
  Dim i As Long
  Dim sItem As String
  Dim j As Long
  Dim v As Variant
  Dim s As String
  
'...
  
  retStatus = Execute(StartUpGDIPlus(GdiPlusVersion))
  If retStatus = OK Then
    GdipInitialized = True
  Else
    Exit Function
  End If
  retStatus = Execute(GdipLoadImageFromFile(StrPtr(sFilename), m_img))
  If retStatus = OK Then
    GetFileProperties.IsPictureFormat = True
    Call Execute(GdipGetPropertyCount(m_img, PropertyCount))
    For i = 1 To PropertyCount
      Set prop = PropertyItem(i, PropertyCount, m_img)
      sItem = ""

      Select Case prop.ItemType
      Case PropertyTagTypeASCII
        sItem = prop.ParseString()
   
      Case PropertyTagTypeRational, PropertyTagTypeSRational
        For j = 1 To prop.ValueCount
          If (j > 1) Then
            sItem = sItem & ", "
          End If
          v = prop.ParseRational(j)
          'sItem = sItem & v(1) & "/" & v(2)
          sItem = sItem & CStr(v(1) / v(2))
        Next j
   
      Case PropertyTagTypeLong
        For j = 1 To prop.ValueCount
          If (j > 1) Then
            sItem = sItem & ", "
          End If
        sItem = sItem & prop.ParseLong(j)
      Next j

      Case PropertyTagTypeShort
        For j = 1 To prop.ValueCount
          If (j > 1) Then
            sItem = sItem & ", "
          End If
          sItem = sItem & prop.ParseShort(j)
        Next j

      Case PropertyTagTypeUndefined
        ReDim b(0 To prop.ValueCount - 1) As Byte
        prop.GetData b
        For j = 1 To prop.ValueCount - 1
          If (j > 1) Then
            sItem = sItem & " "
          End If
          s = Hex(b(j - 1))
          If Len(s) = 1 Then s = "0" & s
          sItem = sItem & s
        Next j

      Case Else
        sItem = sItem & prop.ItemType & " " & prop.length
      End Select
      If Right(sItem, 1) = Chr(0) Then 'убрать нулевой символ на конце
        sItem = Left(sItem, Len(sItem) - 1)
      End If
      sItem = Trim(sItem) 'на всяк. случай
      'заполняем структуру свойствами(если есть требуемые)
      With GetFileProperties
        Select Case prop.Name
          Case "ImageWidth":
            .ImageWidth = Val(sItem)
          Case "ImageHeight":
            .ImageHeight = Val(sItem)
          Case "XResolution":
            .XResolution = Val(sItem)
          Case "YResolution":
            .YResolution = Val(sItem)
          Case "BitsPerSample":
            .BitsPerSample = sItem
          Case "Compression":
            .Compression = sItem
          Case "T4Option":
            .T4Option = sItem
          Case "T6Option":
            .T6Option = sItem
          Case "FillOrder":
            .FillOrder = sItem
          Case Else
        End Select
      End With
    Next i
'...
  Else
    'MsgBox "Not a graphic file!"
  End If
  retStatus = Execute(GdipDisposeImage(m_img))
  If GdipInitialized = True Then
    retStatus = Execute(ShutdownGDIPlus)
  End If
End Function

Private Function PropertyItem(ByVal index As Long, ByVal PropertyCount As Long, ByVal m_img As Long) As GDIPPropertyItem
  Dim lCount As Long
  Dim lPropId() As Long
   
  lCount = PropertyCount
  If (index > 0) And (index <= lCount) Then
    ' Get all property items :
    ReDim lPropId(0 To lCount - 1) As Long
      
    Dim lPtrList As Long
    lPtrList = VarPtr(lPropId(0))
    Call Execute(GdipGetPropertyIdList(m_img, lCount, ByVal lPtrList))
    Set PropertyItem = PropertyItemForID(lPropId(index - 1), m_img)
  End If
End Function

Private Function PropertyItemForID(ByVal lId As Long, ByVal m_img As Long) As GDIPPropertyItem
  Dim lSize As Long
  Call Execute(GdipGetPropertyItemSize(m_img, lId, lSize))
  If (lSize > 0) Then
    ReDim b(0 To lSize - 1) As Byte
    Dim lPtrBuff As Long
    lPtrBuff = VarPtr(b(0))
    Call Execute(LocalGdipGetPropertyItem(m_img, lId, lSize, lPtrBuff))
    Dim p As PropertyItem
    Dim cItem As New GDIPPropertyItem
    Dim lDataSize As Long
    If Not (lPtrBuff = 0) And (lSize > 0) Then
      CopyMemory p, ByVal lPtrBuff, Len(p)
       cItem.fInit p.id, p.length, p.type, p.ValuePtr, lSize
    End If
    Set PropertyItemForID = cItem
  End If
End Function

'=========================
'класс GDIPPropertyItem

Option Explicit

Enum Image_Property_ID_Tags
  PropertyTagExifIFD = &H8769
  PropertyTagsIFD = &H8825
  PropertyTagNewSubfileType = &HFE
  PropertyTagSubfileType = &HFF
  PropertyTagImageWidth = &H100
  PropertyTagImageHeight = &H101
  PropertyTagBitsPerSample = &H102
  PropertyTagCompression = &H103
  PropertyTagPhotometricInterp = &H106
  PropertyTagThreshHolding = &H107
  PropertyTagCellWidth = &H108
  PropertyTagCellHeight = &H109
  PropertyTagFillOrder = &H10A
  PropertyTagDocumentName = &H10D
  PropertyTagImageDescription = &H10E
  PropertyTagEquipMake = &H10F
  PropertyTagEquipModel = &H110
  PropertyTagStripOffsets = &H111
  PropertyTagOrientation = &H112
  PropertyTagSamplesPerPixel = &H115
  PropertyTagRowsPerStrip = &H116
  PropertyTagStripBytesCount = &H117
  PropertyTagMinSampleValue = &H118
  PropertyTagMaxSampleValue = &H119
  PropertyTagXResolution = &H11A            ' Image resolution in width direction
  PropertyTagYResolution = &H11B            ' Image resolution in height direction
  PropertyTagPlanarConfig = &H11C           ' Image data arrangement
  PropertyTagPageName = &H11D
  PropertyTagXPosition = &H11E
  PropertyTagYPosition = &H11F
  PropertyTagFreeOffset = &H120
  PropertyTagFreeByteCounts = &H121
  PropertyTagGrayResponseUnit = &H122
  PropertyTagGrayResponseCurve = &H123
  PropertyTagT4Option = &H124
  PropertyTagT6Option = &H125
  PropertyTagResolutionUnit = &H128         ' Unit of X and Y resolution
  PropertyTagPageNumber = &H129
  PropertyTagTransferFuncition = &H12D
  PropertyTagSoftwareUsed = &H131
  PropertyTagDateTime = &H132
  PropertyTagArtist = &H13B
  PropertyTagHostComputer = &H13C
  PropertyTagPredictor = &H13D
  PropertyTagWhitePoint = &H13E
  PropertyTagPrimaryChromaticities = &H13F
  PropertyTagColorMap = &H140
  PropertyTagHalftoneHints = &H141
  PropertyTagTileWidth = &H142
  PropertyTagTileLength = &H143
  PropertyTagTileOffset = &H144
  PropertyTagTileByteCounts = &H145
  PropertyTagInkSet = &H14C
  PropertyTagInkNames = &H14D
  PropertyTagNumberOfInks = &H14E
  PropertyTagDotRange = &H150
  PropertyTagTargetPrinter = &H151
  PropertyTagExtraSamples = &H152
  PropertyTagSampleFormat = &H153
  PropertyTagSMinSampleValue = &H154
  PropertyTagSMaxSampleValue = &H155
  PropertyTagTransferRange = &H156

  PropertyTagJPEGProc = &H200
  PropertyTagJPEGInterFormat = &H201
  PropertyTagJPEGInterLength = &H202
  PropertyTagJPEGRestartInterval = &H203
  PropertyTagJPEGLosslessPredictors = &H205
  PropertyTagJPEGPointTransforms = &H206
  PropertyTagJPEGQTables = &H207
  PropertyTagJPEGDCTables = &H208
  PropertyTagJPEGACTables = &H209

  PropertyTagYCbCrCoefficients = &H211
  PropertyTagYCbCrSubsampling = &H212
  PropertyTagYCbCrPositioning = &H213
  PropertyTagREFBlackWhite = &H214

  PropertyTagICCProfile = &H8773            ' This TAG is defined by ICC
                                              ' for embedded ICC in TIFF
  PropertyTagGamma = &H301
  PropertyTagICCProfileDescriptor = &H302
  PropertyTagSRGBRenderingIntent = &H303

  PropertyTagImageTitle = &H320
  PropertyTagCopyright = &H8298

  PropertyTagResolutionXUnit = &H5001
  PropertyTagResolutionYUnit = &H5002
  PropertyTagResolutionXLengthUnit = &H5003
  PropertyTagResolutionYLengthUnit = &H5004
  PropertyTagPrintFlags = &H5005
  PropertyTagPrintFlagsVersion = &H5006
  PropertyTagPrintFlagsCrop = &H5007
  PropertyTagPrintFlagsBleedWidth = &H5008
  PropertyTagPrintFlagsBleedWidthScale = &H5009
  PropertyTagHalftoneLPI = &H500A
  PropertyTagHalftoneLPIUnit = &H500B
  PropertyTagHalftoneDegree = &H500C
  PropertyTagHalftoneShape = &H500D
  PropertyTagHalftoneMisc = &H500E
  PropertyTagHalftoneScreen = &H500F
  PropertyTagJPEGQuality = &H5010
  PropertyTagGridSize = &H5011
  PropertyTagThumbnailFormat = &H5012            ' 1 = JPEG, 0 = RAW RGB
  PropertyTagThumbnailWidth = &H5013
  PropertyTagThumbnailHeight = &H5014
  PropertyTagThumbnailColorDepth = &H5015
  PropertyTagThumbnailPlanes = &H5016
  PropertyTagThumbnailRawBytes = &H5017
  PropertyTagThumbnailSize = &H5018
  PropertyTagThumbnailCompressedSize = &H5019
  PropertyTagColorTransferFunction = &H501A
  PropertyTagThumbnailData = &H501B
  PropertyTagThumbnailImageWidth = &H5020        ' Thumbnail width
  PropertyTagThumbnailImageHeight = &H5021       ' Thumbnail height
  PropertyTagThumbnailBitsPerSample = &H5022     ' Number of bits per
                                                   ' component
  PropertyTagThumbnailCompression = &H5023       ' Compression Scheme
  PropertyTagThumbnailPhotometricInterp = &H5024 ' Pixel composition
  PropertyTagThumbnailImageDescription = &H5025  ' Image Tile
  PropertyTagThumbnailEquipMake = &H5026         ' Manufacturer of Image
                                                   ' Input equipment
  PropertyTagThumbnailEquipModel = &H5027        ' Model of Image input
                                                   ' equipment
  PropertyTagThumbnailStripOffsets = &H5028      ' Image data location
  PropertyTagThumbnailOrientation = &H5029       ' Orientation of image
  PropertyTagThumbnailSamplesPerPixel = &H502A   ' Number of components
  PropertyTagThumbnailRowsPerStrip = &H502B      ' Number of rows per strip
  PropertyTagThumbnailStripBytesCount = &H502C   ' Bytes per compressed
                                                   ' strip
  PropertyTagThumbnailResolutionX = &H502D       ' Resolution in width
                                                   ' direction
  PropertyTagThumbnailResolutionY = &H502E       ' Resolution in height
                                                   ' direction
  PropertyTagThumbnailPlanarConfig = &H502F      ' Image data arrangement
  PropertyTagThumbnailResolutionUnit = &H5030    ' Unit of X and Y
                                                   ' Resolution
  PropertyTagThumbnailTransferFunction = &H5031  ' Transfer function
  PropertyTagThumbnailSoftwareUsed = &H5032      ' Software used
  PropertyTagThumbnailDateTime = &H5033          ' File change date and
                                                   ' time
  PropertyTagThumbnailArtist = &H5034            ' Person who created the
                                                   ' image
  PropertyTagThumbnailWhitePoint = &H5035        ' White point chromaticity
  PropertyTagThumbnailPrimaryChromaticities = &H5036
                                                   ' Chromaticities of
                                                   ' primaries
  PropertyTagThumbnailYCbCrCoefficients = &H5037 ' Color space transforma-
                                                   ' tion coefficients
  PropertyTagThumbnailYCbCrSubsampling = &H5038  ' Subsampling ratio of Y
                                                   ' to C
  PropertyTagThumbnailYCbCrPositioning = &H5039  ' Y and C position
  PropertyTagThumbnailRefBlackWhite = &H503A     ' Pair of black and white
                                                   ' reference values
  PropertyTagThumbnailCopyRight = &H503B         ' CopyRight holder

  PropertyTagLuminanceTable = &H5090
  PropertyTagChrominanceTable = &H5091

  PropertyTagFrameDelay = &H5100
  PropertyTagLoopCount = &H5101

  PropertyTagPixelUnit = &H5110          ' Unit specifier for pixel/unit
  PropertyTagPixelPerUnitX = &H5111      ' Pixels per unit in X
  PropertyTagPixelPerUnitY = &H5112      ' Pixels per unit in Y
  PropertyTagPaletteHistogram = &H5113   ' Palette histogram

  PropertyTagExifExposureTime = &H829A
  PropertyTagExifFNumber = &H829D

  PropertyTagExifExposureProg = &H8822
  PropertyTagExifSpectralSense = &H8824
  PropertyTagExifISOSpeed = &H8827
  PropertyTagExifOECF = &H8828

  PropertyTagExifVer = &H9000
  PropertyTagExifDTOrig = &H9003         ' Date & time of original
  PropertyTagExifDTDigitized = &H9004    ' Date & time of digital data generation

  PropertyTagExifCompConfig = &H9101
  PropertyTagExifCompBPP = &H9102

  PropertyTagExifShutterSpeed = &H9201
  PropertyTagExifAperture = &H9202
  PropertyTagExifBrightness = &H9203
  PropertyTagExifExposureBias = &H9204
  PropertyTagExifMaxAperture = &H9205
  PropertyTagExifSubjectDist = &H9206
  PropertyTagExifMeteringMode = &H9207
  PropertyTagExifLightSource = &H9208
  PropertyTagExifFlash = &H9209
  PropertyTagExifFocalLength = &H920A
  PropertyTagExifMakerNote = &H927C
  PropertyTagExifUserComment = &H9286
  PropertyTagExifDTSubsec = &H9290        ' Date & Time subseconds
  PropertyTagExifDTOrigSS = &H9291        ' Date & Time original subseconds
  PropertyTagExifDTDigSS = &H9292         ' Date & TIme digitized subseconds

  PropertyTagExifFPXVer = &HA000
  PropertyTagExifColorSpace = &HA001
  PropertyTagExifPixXDim = &HA002
  PropertyTagExifPixYDim = &HA003
  PropertyTagExifRelatedWav = &HA004      ' related sound file
  PropertyTagExifInterop = &HA005
  PropertyTagExifFlashEnergy = &HA20B
  PropertyTagExifSpatialFR = &HA20C       ' Spatial Frequency Response
  PropertyTagExifFocalXRes = &HA20E       ' Focal Plane X Resolution
  PropertyTagExifFocalYRes = &HA20F       ' Focal Plane Y Resolution
  PropertyTagExifFocalResUnit = &HA210    ' Focal Plane Resolution Unit
  PropertyTagExifSubjectLoc = &HA214
  PropertyTagExifExposureIndex = &HA215
  PropertyTagExifSensingMethod = &HA217
  PropertyTagExifFileSource = &HA300
  PropertyTagExifSceneType = &HA301
  PropertyTagExifCfaPattern = &HA302

  PropertyTagGpsVer = &H0
  PropertyTagGpsLatitudeRef = &H1
  PropertyTagGpsLatitude = &H2
  PropertyTagGpsLongitudeRef = &H3
  PropertyTagGpsLongitude = &H4
  PropertyTagGpsAltitudeRef = &H5
  PropertyTagGpsAltitude = &H6
  PropertyTagGpsGpsTime = &H7
  PropertyTagGpsGpsSatellites = &H8
  PropertyTagGpsGpsStatus = &H9
  PropertyTagGpsGpsMeasureMode = &HA
  PropertyTagGpsGpsDop = &HB              ' Measurement precision
  PropertyTagGpsSpeedRef = &HC
  PropertyTagGpsSpeed = &HD
  PropertyTagGpsTrackRef = &HE
  PropertyTagGpsTrack = &HF
  PropertyTagGpsImgDirRef = &H10
  PropertyTagGpsImgDir = &H11
  PropertyTagGpsMapDatum = &H12
  PropertyTagGpsDestLatRef = &H13
  PropertyTagGpsDestLat = &H14
  PropertyTagGpsDestLongRef = &H15
  PropertyTagGpsDestLong = &H16
  PropertyTagGpsDestBearRef = &H17
  PropertyTagGpsDestBear = &H18
  PropertyTagGpsDestDistRef = &H19
  PropertyTagGpsDestDist = &H1A
End Enum

Private m_lId As Long
Private m_lLength As Long
Private m_itemType As PropertyTagType
Private m_bData() As Byte

Public Property Get id() As Long
  id = m_lId
End Property

Public Property Get ItemType() As PropertyTagType
  ItemType = m_itemType
End Property

Public Property Get length() As Long
  length = m_lLength
End Property

Public Property Get Name() As String
  Select Case m_lId
    Case PropertyTagExifIFD
      Name = "ExifIFD"
    Case PropertyTagsIFD
      Name = "IFD"
    Case PropertyTagNewSubfileType
      Name = "NewSubfileType"
    Case PropertyTagSubfileType
      Name = "TagSubFileType"
    Case PropertyTagImageWidth
      Name = "ImageWidth"
    Case PropertyTagImageHeight
      Name = "ImageHeight"
    Case PropertyTagBitsPerSample
      Name = "BitsPerSample"
    Case PropertyTagCompression
      Name = "Compression"
    Case PropertyTagPhotometricInterp
      Name = "PhotometricInterp"
    Case PropertyTagThreshHolding
      Name = "ThreshHolding"
    Case PropertyTagCellWidth
      Name = "CellWidth"
    Case PropertyTagCellHeight
      Name = "CellHeight"
    Case PropertyTagFillOrder
      Name = "FillOrder"
    Case PropertyTagDocumentName
      Name = "DocumentName"
    Case PropertyTagImageDescription
      Name = "ImageDescription"
    Case PropertyTagEquipMake
      Name = "EquipMake"
    Case PropertyTagEquipModel
      Name = "EquipModel"
    Case PropertyTagStripOffsets
      Name = "StripOffsets"
    Case PropertyTagOrientation
      Name = "Orientation"
    Case PropertyTagSamplesPerPixel
      Name = "SamplesPerPixel"
    Case PropertyTagRowsPerStrip
      Name = "RowsPerStrip"
    Case PropertyTagStripBytesCount
      Name = "StripBytesCount"
    Case PropertyTagMinSampleValue
      Name = "MinSampleValue"
    Case PropertyTagMaxSampleValue
      Name = "MaxSampleValue"
    Case PropertyTagXResolution
      Name = "XResolution"
    Case PropertyTagYResolution
      Name = "YResolution"
    Case PropertyTagPlanarConfig
      Name = "PlanarConfig"
    Case PropertyTagPageName
      Name = "PageName"
    Case PropertyTagXPosition
      Name = "XPosition"
    Case PropertyTagYPosition
      Name = "YPosition"
    Case PropertyTagFreeOffset
      Name = "FreeOffset"
    Case PropertyTagFreeByteCounts
      Name = "FreeByteCounts"
    Case PropertyTagGrayResponseUnit
      Name = "GrayResponseUnit"
    Case PropertyTagGrayResponseCurve
      Name = "GrayResponseCurve"
    Case PropertyTagT4Option
      Name = "T4Option"
    Case PropertyTagT6Option
      Name = "T6Option"
    Case PropertyTagResolutionUnit
      Name = "ResolutionUnit"
    Case PropertyTagPageNumber
      Name = "PageNumber"
    Case PropertyTagTransferFuncition
      Name = "TransferFuncition"
    Case PropertyTagSoftwareUsed
      Name = "SoftwareUsed"
    Case PropertyTagDateTime
      Name = "DateTime"
    Case PropertyTagArtist
      Name = "Artist"
    Case PropertyTagHostComputer
      Name = "HostComputer"
    Case PropertyTagPredictor
      Name = "Predictor"
    Case PropertyTagWhitePoint
      Name = "WhitePoint"
    Case PropertyTagPrimaryChromaticities
      Name = "PrimaryChromaticities"
    Case PropertyTagColorMap
      Name = "ColorMap"
    Case PropertyTagHalftoneHints
      Name = "HalftoneHints"
    Case PropertyTagTileWidth
      Name = "TileWidth"
    Case PropertyTagTileLength
      Name = "TileLength"
    Case PropertyTagTileOffset
      Name = "TileOffset"
    Case PropertyTagTileByteCounts
      Name = "TileByteCounts"
    Case PropertyTagInkSet
      Name = "InkSet"
    Case PropertyTagInkNames
      Name = "InkNames"
    Case PropertyTagNumberOfInks
      Name = "NumberOfInks"
    Case PropertyTagDotRange
      Name = "DotRange"
    Case PropertyTagTargetPrinter
      Name = "TargetPrinter"
    Case PropertyTagExtraSamples
      Name = "ExtraSamples"
    Case PropertyTagSampleFormat
      Name = "SampleFormat"
    Case PropertyTagSMinSampleValue
      Name = "SMinSampleValue"
    Case PropertyTagSMaxSampleValue
      Name = "SMaxSampleValue"
    Case PropertyTagTransferRange
      Name = "TransferRange"
    Case PropertyTagJPEGProc
      Name = "JPEGProc"
    Case PropertyTagJPEGInterFormat
      Name = "JPEGInterFormat"
    Case PropertyTagJPEGInterLength
      Name = "JPEGInterLength"
    Case PropertyTagJPEGRestartInterval
      Name = "JPEGRestartInterval"
    Case PropertyTagJPEGLosslessPredictors
      Name = "JPEGLosslessPredictors"
    Case PropertyTagJPEGPointTransforms
      Name = "JPEointTransforms"
    Case PropertyTagJPEGQTables
      Name = "JPEGQTables"
    Case PropertyTagJPEGDCTables
      Name = "JPEGDCTables"
    Case PropertyTagJPEGACTables
      Name = "JPEGACTables"
    Case PropertyTagYCbCrCoefficients
      Name = "YCbCrCoefficients"
    Case PropertyTagYCbCrSubsampling
      Name = "YCbCrSubsampling"
    Case PropertyTagYCbCrPositioning
      Name = "YCbCrPositioning"
    Case PropertyTagREFBlackWhite
      Name = "REFBlackWhite"
    Case PropertyTagICCProfile
      Name = "ICCProfile"
    Case PropertyTagGamma
      Name = "Gamma"
    Case PropertyTagICCProfileDescriptor
      Name = "ICCProfileDescriptor"
    Case PropertyTagSRGBRenderingIntent
      Name = "SRGBRenderingIntent"
    Case PropertyTagImageTitle
      Name = "ImageTitle"
    Case PropertyTagCopyright
      Name = "Copyright"
    Case PropertyTagResolutionXUnit
      Name = "ResolutionXUnit"
    Case PropertyTagResolutionYUnit
      Name = "ResolutionYUnit"
    Case PropertyTagResolutionXLengthUnit
      Name = "ResolutionXLengthUnit"
    Case PropertyTagResolutionYLengthUnit
      Name = "ResolutionYLengthUnit"
    Case PropertyTagPrintFlags
      Name = "PrintFlags"
    Case PropertyTagPrintFlagsVersion
      Name = "PrintFlagsVersion"
    Case PropertyTagPrintFlagsCrop
      Name = "PrintFlagsCrop"
    Case PropertyTagPrintFlagsBleedWidth
      Name = "PrintFlagsBleedWidth"
    Case PropertyTagPrintFlagsBleedWidthScale
      Name = "PrintFlagsBleedWidthScale"
    Case PropertyTagHalftoneLPI
      Name = "HalftoneLPI"
    Case PropertyTagHalftoneLPIUnit
      Name = "HalftoneLPIUnit"
    Case PropertyTagHalftoneDegree
      Name = "HalftoneDegree"
    Case PropertyTagHalftoneShape
      Name = "HalftoneShape"
    Case PropertyTagHalftoneMisc
      Name = "HalftoneMisc"
    Case PropertyTagHalftoneScreen
      Name = "HalftoneScreen"
    Case PropertyTagJPEGQuality
      Name = "JPEGQuality"
    Case PropertyTagGridSize
      Name = "GridSize"
    Case PropertyTagThumbnailFormat
      Name = "ThumbnailFormat"
    Case PropertyTagThumbnailWidth
      Name = "ThumbnailWidth"
    Case PropertyTagThumbnailHeight
      Name = "ThumbnailHeight"
    Case PropertyTagThumbnailColorDepth
      Name = "ThumbnailColorDepth"
    Case PropertyTagThumbnailPlanes
      Name = "ThumbnailPlanes"
    Case PropertyTagThumbnailRawBytes
      Name = "ThumbnailRawBytes"
    Case PropertyTagThumbnailSize
      Name = "ThumbnailSize"
    Case PropertyTagThumbnailCompressedSize
      Name = "ThumbnailCompressedSize"
    Case PropertyTagColorTransferFunction
      Name = "ColorTransferFunction"
    Case PropertyTagThumbnailData
      Name = "ThumbnailData"
    Case PropertyTagThumbnailImageWidth
      Name = "ThumbnailImageWidth"
    Case PropertyTagThumbnailImageHeight
      Name = "ThumbnailImageHeight"
    Case PropertyTagThumbnailBitsPerSample
      Name = "ThumbnailBitsPerSample"
    Case PropertyTagThumbnailCompression
      Name = "ThumbnailCompression"
    Case PropertyTagThumbnailPhotometricInterp
      Name = "ThumbnailPhotometricInterp"
    Case PropertyTagThumbnailImageDescription
      Name = "ThumbnailImageDescription"
    Case PropertyTagThumbnailEquipMake
      Name = "ThumbnailEquipMake"
    Case PropertyTagThumbnailEquipModel
      Name = "ThumbnailEquipModel"
    Case PropertyTagThumbnailStripOffsets
      Name = "ThumbnailStripOffsets"
    Case PropertyTagThumbnailOrientation
      Name = "ThumbnailOrientation"
    Case PropertyTagThumbnailSamplesPerPixel
      Name = "ThumbnailSamplesPerPixel"
    Case PropertyTagThumbnailRowsPerStrip
      Name = "ThumbnailRowsPerStrip"
    Case PropertyTagThumbnailStripBytesCount
      Name = "ThumbnailStripBytesCount"
    Case PropertyTagThumbnailResolutionX
      Name = "ThumbnailResolutionX"
    Case PropertyTagThumbnailResolutionY
      Name = "ThumbnailResolutionY"
    Case PropertyTagThumbnailPlanarConfig
      Name = "ThumbnailPlanarConfig"
    Case PropertyTagThumbnailResolutionUnit
      Name = "ThumbnailResolutionUnit"
    Case PropertyTagThumbnailTransferFunction
      Name = "ThumbnailTransferFunction"
    Case PropertyTagThumbnailSoftwareUsed
      Name = "ThumbnailSoftwareUsed"
    Case PropertyTagThumbnailDateTime
      Name = "ThumbnailDateTime"
    Case PropertyTagThumbnailArtist
      Name = "ThumbnailArtist"
    Case PropertyTagThumbnailWhitePoint
      Name = "ThumbnailWhitePoint"
    Case PropertyTagThumbnailPrimaryChromaticities
      Name = "ThumbnailPrimaryChromaticities"
    Case PropertyTagThumbnailYCbCrCoefficients
      Name = "ThumbnailYCbCrCoefficients"
    Case PropertyTagThumbnailYCbCrSubsampling
      Name = "ThumbnailYCbCrSubsampling"
    Case PropertyTagThumbnailYCbCrPositioning
      Name = "ThumbnailYCbCrPositioning"
    Case PropertyTagThumbnailRefBlackWhite
      Name = "ThumbnailRefBlackWhite"
    Case PropertyTagThumbnailCopyRight
      Name = "ThumbnailCopyRight"
    Case PropertyTagLuminanceTable
      Name = "LuminanceTable"
    Case PropertyTagChrominanceTable
      Name = "ChrominanceTable"
    Case PropertyTagFrameDelay
      Name = "FrameDelay"
    Case PropertyTagLoopCount
      Name = "LoopCount"
    Case PropertyTagPixelUnit
      Name = "PixelUnit"
    Case PropertyTagPixelPerUnitX
      Name = "PixelPerUnitX"
    Case PropertyTagPixelPerUnitY
      Name = "PixelPerUnitY"
    Case PropertyTagPaletteHistogram
      Name = "PaletteHistogram"
    Case PropertyTagExifExposureTime
      Name = "ExifExposureTime"
    Case PropertyTagExifFNumber
      Name = "ExifFNumber"
    Case PropertyTagExifExposureProg
      Name = "ExifExposureProg"
    Case PropertyTagExifSpectralSense
      Name = "ExifSpectralSense"
    Case PropertyTagExifISOSpeed
      Name = "ExifISOSpeed"
    Case PropertyTagExifOECF
      Name = "ExifOECF"
    Case PropertyTagExifVer
      Name = "ExifVer"
    Case PropertyTagExifDTOrig
      Name = "ExifDTOrig"
    Case PropertyTagExifDTDigitized
      Name = "ExifDTDigitized"
    Case PropertyTagExifCompConfig
      Name = "ExifCompConfig"
    Case PropertyTagExifCompBPP
      Name = "ExifCompBPP"
    Case PropertyTagExifShutterSpeed
      Name = "ExifShutterSpeed"
    Case PropertyTagExifAperture
      Name = "ExifAperture"
    Case PropertyTagExifBrightness
      Name = "ExifBrightness"
    Case PropertyTagExifExposureBias
      Name = "ExifExposureBias"
    Case PropertyTagExifMaxAperture
      Name = "ExifMaxAperture"
    Case PropertyTagExifSubjectDist
      Name = "ExifSubjectDist"
    Case PropertyTagExifMeteringMode
      Name = "ExifMeteringMode"
    Case PropertyTagExifLightSource
      Name = "ExifLightSource"
    Case PropertyTagExifFlash
      Name = "ExifFlash"
    Case PropertyTagExifFocalLength
      Name = "ExifFocalLength"
    Case PropertyTagExifMakerNote
      Name = "ExifMakerNote"
    Case PropertyTagExifUserComment
      Name = "ExifUserComment"
    Case PropertyTagExifDTSubsec
      Name = "ExifDTSubsec"
    Case PropertyTagExifDTOrigSS
      Name = "ExifDTOrigSS"
    Case PropertyTagExifDTDigSS
      Name = "ExifDTDigSS"
    Case PropertyTagExifFPXVer
      Name = "ExifFPXVer"
    Case PropertyTagExifColorSpace
      Name = "ExifColorSpace"
    Case PropertyTagExifPixXDim
      Name = "ExifPixXDim"
    Case PropertyTagExifPixYDim
      Name = "ExifPixYDim"
    Case PropertyTagExifRelatedWav
      Name = "ExifRelatedWav"
    Case PropertyTagExifInterop
      Name = "ExifInterop"
    Case PropertyTagExifFlashEnergy
      Name = "ExifFlashEnergy"
    Case PropertyTagExifSpatialFR
      Name = "ExifSpatialFR"
    Case PropertyTagExifFocalXRes
      Name = "ExifFocalXRes"
    Case PropertyTagExifFocalYRes
      Name = "ExifFocalYRes"
    Case PropertyTagExifFocalResUnit
      Name = "ExifFocalResUnit"
    Case PropertyTagExifSubjectLoc
      Name = "ExifSubjectLoc"
    Case PropertyTagExifExposureIndex
      Name = "ExifExposureIndex"
    Case PropertyTagExifSensingMethod
      Name = "ExifSensingMethod"
    Case PropertyTagExifFileSource
      Name = "ExifFileSource"
    Case PropertyTagExifSceneType
      Name = "ExifSceneType"
    Case PropertyTagExifCfaPattern
      Name = "ExifCfaPattern"
    Case PropertyTagGpsVer
      Name = "GpsVer"
    Case PropertyTagGpsLatitudeRef
      Name = "GpsLatitudeRef"
    Case PropertyTagGpsLatitude
      Name = "GpsLatitude"
    Case PropertyTagGpsLongitudeRef
      Name = "GpsLongitudeRef"
    Case PropertyTagGpsLongitude
      Name = "GpsLongitude"
    Case PropertyTagGpsAltitudeRef
      Name = "GpsAltitudeRef"
    Case PropertyTagGpsAltitude
      Name = "GpsAltitude"
    Case PropertyTagGpsGpsTime
      Name = "GpsGpsTime"
    Case PropertyTagGpsGpsSatellites
      Name = "GpsGpsSatellites"
    Case PropertyTagGpsGpsStatus
      Name = "GpsGpsStatus"
    Case PropertyTagGpsGpsMeasureMode
      Name = "GpsGpsMeasureMode"
    Case PropertyTagGpsGpsDop
      Name = "GpsGpsDop"
    Case PropertyTagGpsSpeedRef
      Name = "GpsSpeedRef"
    Case PropertyTagGpsSpeed
      Name = "GpsSpeed"
    Case PropertyTagGpsTrackRef
      Name = "GpsTrackRef"
    Case PropertyTagGpsTrack
      Name = "GpsTrack"
    Case PropertyTagGpsImgDirRef
      Name = "GpsImgDirRef"
    Case PropertyTagGpsImgDir
      Name = "GpsImgDir"
    Case PropertyTagGpsMapDatum
      Name = "GpsMapDatum"
    Case PropertyTagGpsDestLatRef
      Name = "GpsDestLatRef"
    Case PropertyTagGpsDestLat
      Name = "GpsDestLat"
    Case PropertyTagGpsDestLongRef
      Name = "GpsDestLongRef"
    Case PropertyTagGpsDestLong
      Name = "GpsDestLong"
    Case PropertyTagGpsDestBearRef
      Name = "GpsDestBearRef"
    Case PropertyTagGpsDestBear
      Name = "GpsDestBear"
    Case PropertyTagGpsDestDistRef
      Name = "GpsDestDistRef"
    Case PropertyTagGpsDestDist
      Name = "GpsDestDist"

  End Select
End Property

Public Function ValueCount() As Long
  Select Case ItemType
   Case PropertyTagTypeASCII
     ' each item is 1 byte:
     ValueCount = 1
  
   Case PropertyTagTypeUndefined, PropertyTagTypeByte, 6 ' sbyte
     ValueCount = m_lLength
     
   Case PropertyTagTypeShort, 8 ' schar
     ' each item is 2 bytes:
     ValueCount = m_lLength / 2
     
   Case PropertyTagTypeRational, PropertyTagTypeSRational, 12 ' double
     ' each item is 8 bytes:
     ValueCount = m_lLength / 8
     
   Case PropertyTagTypeLong, PropertyTagTypeSLong, 11 ' float
     ' each item is 4 bytes:
     ValueCount = m_lLength / 4
     
  End Select

End Function

Public Property Get ParseString() As String
  ParseString = StrConv(m_bData, vbUnicode)
End Property

Public Property Get ParseRational(ByVal lItem As Long) As Variant
  Dim lStart As Long
  If (lItem > 0) And (lItem <= ValueCount) Then
    lStart = (lItem - 1) * 8
    ReDim lValue(1 To 2) As Long
    CopyMemory lValue(1), m_bData(lStart), 4
    CopyMemory lValue(2), m_bData(lStart + 4), 4
    ParseRational = lValue
  Else
    'SetStatusHelper InvalidParameter
  End If
End Property

Public Property Get ParseShort(ByVal lItem As Long) As Integer
  Dim lStart As Long
  If (lItem > 0) And (lItem <= ValueCount) Then
    lStart = (lItem - 1) * 2
    Dim iRet As Integer
    CopyMemory iRet, m_bData(lStart), 2
    ParseShort = iRet
  Else
    'SetStatusHelper InvalidParameter
  End If
End Property

Public Property Get ParseLong(ByVal lItem As Long) As Long
  Dim lStart As Long
  If (lItem > 0) And (lItem <= ValueCount) Then
    lStart = (lItem - 1) * 4
    Dim iRet As Long
    CopyMemory iRet, m_bData(lStart), 4
    ParseLong = iRet
  Else
    'SetStatusHelper InvalidParameter
  End If
End Property

Public Sub GetData(ByRef b() As Byte)
  Dim i As Long
  If (m_lLength > 0) Then
    For i = LBound(b) To UBound(b)
      b(i) = m_bData(i - LBound(b))
    Next i
  End If
End Sub

Public Property Get DataBufferSize() As Long
  DataBufferSize = ElementDataSize() * m_lLength
End Property

Public Property Get ElementDataSize() As Long
  Dim lSize As Long
  Select Case ItemType
    Case PropertyTagTypeASCII, PropertyTagTypeUndefined, PropertyTagTypeByte, 6 ' sbyte
      ' each item is 1 byte:
      lSize = 1
    Case PropertyTagTypeShort, 8 ' schar
      ' each item is 2 bytes:
      lSize = 2
    Case PropertyTagTypeRational, PropertyTagTypeSRational, 12 ' double
      ' each item is 8 bytes:
      lSize = 8
    Case PropertyTagTypeLong, PropertyTagTypeSLong, 11 ' float
      ' each item is 4 bytes:
      lSize = 4
   End Select
   ElementDataSize = lSize
End Property

Public Sub Create( _
      ByVal lId As Long, _
      ByVal lLength As Long, _
      ByVal eItemType As PropertyTagType, _
      ByRef b() As Byte _
  )
  Dim i As Long
  m_lId = lId
  m_lLength = lLength
  m_itemType = eItemType
  If (m_lLength > 0) Then
    ReDim m_bData(LBound(b) To UBound(b))
    For i = LBound(b) To UBound(b)
      m_bData(i - LBound(b)) = b(i)
    Next i
  End If
End Sub

Friend Sub fInit( _
      ByVal lId As Long, _
      ByVal lLength As Long, _
      ByVal eItemType As PropertyTagType, _
      ByVal lPtr As Long, _
      ByVal lSize As Long _
  )
  m_lId = lId
  m_lLength = lLength
  m_itemType = eItemType
  If Not (lPtr = 0) And (lLength > 0) Then
    Dim lDataSize As Long
    lDataSize = lSize - 16
    If (lDataSize > 0) Then
      ReDim m_bData(0 To lDataSize - 1) As Byte
      CopyMemory m_bData(0), ByVal lPtr, lDataSize
    End If
  End If
End Sub



Ну т.е. грубо, мне нужно пробежаться по всем PropertyItem и заполнить свою структуру несколькими интересуемыми свойствами
Моя структура грубо такая:
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
  <StructLayout(LayoutKind.Sequential)>
  Public Structure PictureFileProp
    Dim ImageWidth As Integer '1728
    Dim ImageHeight As Integer '2340 1171
    Dim XResolution As Single '204
    Dim YResolution As Single '196 98
    Dim BitsPerSample As String '1 для ч/б
    Dim Compression As String
    Dim T4Option As String
    Dim T6Option As String
    Dim FillOrder As String
...
  End Structure



Нужен какой-то хороший пример на .Net который копает PropertyItem на предмет Имя(Tag)/Type/Value.
В оф.документации пока не нашел.
...
Рейтинг: 0 / 0
Как в .Net выкапывать свойства и значения из PropertyItems GDI+-совместимого файла?
    #38952097
Дмитрий77
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
авторPropertyItem на предмет Имя(Tag)/Type/Value
Да не, вроде все есть:

PropertyItem.Id Property

PropertyItem.Type Property

PropertyItem.Value Property

Но ничего сверхудобного. То есть все Enum-ы, проверки типов, извлечения Value, т.е. класс целиком придется таки тупо писать ручками по образу и подобию.
...
Рейтинг: 0 / 0
Как в .Net выкапывать свойства и значения из PropertyItems GDI+-совместимого файла?
    #38952286
Дмитрий77
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Как-то так:
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
...
    Try
      m_img = Image.FromFile(sFilename)
      GetFileProperties.IsPictureFormat = True
      'Get the PropertyItems property from image. 
      Dim propItems As PropertyItem() = m_img.PropertyItems
      For Each propItem As PropertyItem In propItems
        sItem = ""
        Select Case propItem.Type
          Case PropertyTagType.PropertyTagTypeASCII
            sItem = PropertyItem_ParseString(propItem)
          Case PropertyTagType.PropertyTagTypeRational, PropertyTagType.PropertyTagTypeSRational
            For j As Integer = 1 To PropertyItem_ValueCount(propItem)
              If (j > 1) Then sItem = sItem & ", "
              Dim v As Object = PropertyItem_ParseRational(propItem, j)
              If Not v Is Nothing AndAlso v(1) <> 0 Then
                Try : sItem = sItem & CStr(v(0) / v(1)) : Catch : End Try 'хз насколько это корректно
              End If
            Next j
          Case PropertyTagType.PropertyTagTypeLong
            For j As Integer = 1 To PropertyItem_ValueCount(propItem)
              If (j > 1) Then sItem = sItem & ", "
              sItem = sItem & PropertyItem_ParseLong(propItem, j).ToString
            Next
          Case PropertyTagType.PropertyTagTypeShort
            For j As Integer = 1 To PropertyItem_ValueCount(propItem)
              If j > 1 Then sItem = sItem & ", "
              sItem = sItem & PropertyItem_ParseShort(propItem, j).ToString
            Next
          Case PropertyTagType.PropertyTagTypeUndefined
            sItem = BitConverter.ToString(propItem.Value)
          Case Else
            sItem = sItem & propItem.Type.ToString & " " & propItem.Len 'вряд ли это имеет смысл
        End Select
        If Strings.Right(sItem, 1) = Chr(0) Then 'убрать нулевой символ на конце(похоже бессмысленно)
          sItem = Strings.Left(sItem, Strings.Len(sItem) - 1)
        End If
        sItem = Trim(sItem) 'на всяк. случай
        Debug.Print(PropertyItem_Name(propItem) & "=" & sItem)
...
       m_img.Dispose()
    Catch
      'MsgBox "Not a graphic file!"
    End Try



Вообще конечно девелоперы .Net могли бы и добавить штатные Enum для Id и Type, а также какие-нибудь методы для удобного доставания Value. Без этого PropertyItem Class сильно обкоцкан и не тянет на общий уровень обертки над GDI+ которая в целом то неплоха.
Если для PropertyItem.Id хотя бы перечислены константы (типа рисуйте сами), то для PropertyItem.Type даже этого нету (только описания для значений Short/Int16). А из .Value доставайте результат как хотите. А про то что в .Value может быть засунуто несколько значений указанного Type даже намеков нет. Без каких-то базовых знаний по этому вопросу хрен этим нормально воспользуешься.
Класс писать не стал, чего его дублировать, ограничился модулем-простыней с двумя Enum и несколькими полезными функциями.
Код: vbnet
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468.
469.
470.
471.
472.
473.
474.
475.
476.
477.
478.
479.
480.
481.
482.
483.
484.
485.
486.
487.
488.
489.
490.
491.
492.
493.
494.
495.
496.
497.
498.
499.
500.
501.
502.
503.
504.
505.
506.
507.
508.
509.
510.
511.
512.
513.
514.
515.
516.
517.
518.
519.
520.
521.
522.
523.
524.
525.
526.
527.
528.
529.
530.
531.
532.
533.
534.
535.
536.
537.
538.
539.
540.
541.
542.
543.
544.
545.
546.
547.
548.
549.
550.
551.
552.
553.
554.
555.
556.
557.
558.
559.
560.
561.
562.
563.
564.
565.
566.
567.
568.
569.
570.
571.
572.
573.
574.
575.
576.
577.
578.
579.
580.
581.
582.
583.
584.
585.
586.
587.
588.
589.
590.
591.
592.
593.
594.
595.
596.
597.
598.
599.
600.
601.
602.
603.
604.
605.
606.
607.
608.
609.
610.
611.
612.
613.
614.
615.
616.
617.
618.
619.
620.
621.
622.
623.
624.
625.
626.
627.
628.
629.
630.
631.
632.
633.
634.
635.
636.
637.
638.
639.
640.
641.
642.
643.
644.
645.
646.
647.
648.
649.
650.
651.
652.
653.
654.
655.
656.
657.
658.
659.
660.
661.
662.
663.
664.
665.
666.
667.
668.
669.
670.
671.
672.
673.
674.
675.
676.
677.
678.
679.
680.
681.
682.
683.
684.
685.
686.
687.
688.
689.
690.
691.
692.
693.
694.
695.
696.
697.
698.
699.
700.
701.
702.
703.
704.
705.
706.
707.
708.
709.
710.
711.
712.
713.
714.
715.
716.
717.
718.
719.
720.
721.
722.
723.
724.
725.
726.
727.
728.
729.
730.
731.
732.
733.
734.
735.
736.
737.
738.
739.
740.
741.
742.
743.
744.
745.
746.
747.
748.
749.
750.
751.
752.
753.
754.
755.
756.
757.
758.
759.
760.
761.
762.
763.
Imports System.Drawing.Imaging

Module m_GDIPPropertyItem

  Public Enum Image_Property_ID_Tags
    PropertyTagExifIFD = &H8769
    PropertyTagsIFD = &H8825
    PropertyTagNewSubfileType = &HFE
    PropertyTagSubfileType = &HFF
    PropertyTagImageWidth = &H100
    PropertyTagImageHeight = &H101
    PropertyTagBitsPerSample = &H102
    PropertyTagCompression = &H103
    PropertyTagPhotometricInterp = &H106
    PropertyTagThreshHolding = &H107
    PropertyTagCellWidth = &H108
    PropertyTagCellHeight = &H109
    PropertyTagFillOrder = &H10A
    PropertyTagDocumentName = &H10D
    PropertyTagImageDescription = &H10E
    PropertyTagEquipMake = &H10F
    PropertyTagEquipModel = &H110
    PropertyTagStripOffsets = &H111
    PropertyTagOrientation = &H112
    PropertyTagSamplesPerPixel = &H115
    PropertyTagRowsPerStrip = &H116
    PropertyTagStripBytesCount = &H117
    PropertyTagMinSampleValue = &H118
    PropertyTagMaxSampleValue = &H119
    PropertyTagXResolution = &H11A            ' Image resolution in width direction
    PropertyTagYResolution = &H11B            ' Image resolution in height direction
    PropertyTagPlanarConfig = &H11C           ' Image data arrangement
    PropertyTagPageName = &H11D
    PropertyTagXPosition = &H11E
    PropertyTagYPosition = &H11F
    PropertyTagFreeOffset = &H120
    PropertyTagFreeByteCounts = &H121
    PropertyTagGrayResponseUnit = &H122
    PropertyTagGrayResponseCurve = &H123
    PropertyTagT4Option = &H124
    PropertyTagT6Option = &H125
    PropertyTagResolutionUnit = &H128         ' Unit of X and Y resolution
    PropertyTagPageNumber = &H129
    PropertyTagTransferFuncition = &H12D
    PropertyTagSoftwareUsed = &H131
    PropertyTagDateTime = &H132
    PropertyTagArtist = &H13B
    PropertyTagHostComputer = &H13C
    PropertyTagPredictor = &H13D
    PropertyTagWhitePoint = &H13E
    PropertyTagPrimaryChromaticities = &H13F
    PropertyTagColorMap = &H140
    PropertyTagHalftoneHints = &H141
    PropertyTagTileWidth = &H142
    PropertyTagTileLength = &H143
    PropertyTagTileOffset = &H144
    PropertyTagTileByteCounts = &H145
    PropertyTagInkSet = &H14C
    PropertyTagInkNames = &H14D
    PropertyTagNumberOfInks = &H14E
    PropertyTagDotRange = &H150
    PropertyTagTargetPrinter = &H151
    PropertyTagExtraSamples = &H152
    PropertyTagSampleFormat = &H153
    PropertyTagSMinSampleValue = &H154
    PropertyTagSMaxSampleValue = &H155
    PropertyTagTransferRange = &H156

    PropertyTagJPEGProc = &H200
    PropertyTagJPEGInterFormat = &H201
    PropertyTagJPEGInterLength = &H202
    PropertyTagJPEGRestartInterval = &H203
    PropertyTagJPEGLosslessPredictors = &H205
    PropertyTagJPEGPointTransforms = &H206
    PropertyTagJPEGQTables = &H207
    PropertyTagJPEGDCTables = &H208
    PropertyTagJPEGACTables = &H209

    PropertyTagYCbCrCoefficients = &H211
    PropertyTagYCbCrSubsampling = &H212
    PropertyTagYCbCrPositioning = &H213
    PropertyTagREFBlackWhite = &H214

    PropertyTagICCProfile = &H8773            ' This TAG is defined by ICC
    ' for embedded ICC in TIFF
    PropertyTagGamma = &H301
    PropertyTagICCProfileDescriptor = &H302
    PropertyTagSRGBRenderingIntent = &H303

    PropertyTagImageTitle = &H320
    PropertyTagCopyright = &H8298

    PropertyTagResolutionXUnit = &H5001
    PropertyTagResolutionYUnit = &H5002
    PropertyTagResolutionXLengthUnit = &H5003
    PropertyTagResolutionYLengthUnit = &H5004
    PropertyTagPrintFlags = &H5005
    PropertyTagPrintFlagsVersion = &H5006
    PropertyTagPrintFlagsCrop = &H5007
    PropertyTagPrintFlagsBleedWidth = &H5008
    PropertyTagPrintFlagsBleedWidthScale = &H5009
    PropertyTagHalftoneLPI = &H500A
    PropertyTagHalftoneLPIUnit = &H500B
    PropertyTagHalftoneDegree = &H500C
    PropertyTagHalftoneShape = &H500D
    PropertyTagHalftoneMisc = &H500E
    PropertyTagHalftoneScreen = &H500F
    PropertyTagJPEGQuality = &H5010
    PropertyTagGridSize = &H5011
    PropertyTagThumbnailFormat = &H5012            ' 1 = JPEG, 0 = RAW RGB
    PropertyTagThumbnailWidth = &H5013
    PropertyTagThumbnailHeight = &H5014
    PropertyTagThumbnailColorDepth = &H5015
    PropertyTagThumbnailPlanes = &H5016
    PropertyTagThumbnailRawBytes = &H5017
    PropertyTagThumbnailSize = &H5018
    PropertyTagThumbnailCompressedSize = &H5019
    PropertyTagColorTransferFunction = &H501A
    PropertyTagThumbnailData = &H501B
    PropertyTagThumbnailImageWidth = &H5020        ' Thumbnail width
    PropertyTagThumbnailImageHeight = &H5021       ' Thumbnail height
    PropertyTagThumbnailBitsPerSample = &H5022     ' Number of bits per
    ' component
    PropertyTagThumbnailCompression = &H5023       ' Compression Scheme
    PropertyTagThumbnailPhotometricInterp = &H5024 ' Pixel composition
    PropertyTagThumbnailImageDescription = &H5025  ' Image Tile
    PropertyTagThumbnailEquipMake = &H5026         ' Manufacturer of Image
    ' Input equipment
    PropertyTagThumbnailEquipModel = &H5027        ' Model of Image input
    ' equipment
    PropertyTagThumbnailStripOffsets = &H5028      ' Image data location
    PropertyTagThumbnailOrientation = &H5029       ' Orientation of image
    PropertyTagThumbnailSamplesPerPixel = &H502A   ' Number of components
    PropertyTagThumbnailRowsPerStrip = &H502B      ' Number of rows per strip
    PropertyTagThumbnailStripBytesCount = &H502C   ' Bytes per compressed
    ' strip
    PropertyTagThumbnailResolutionX = &H502D       ' Resolution in width
    ' direction
    PropertyTagThumbnailResolutionY = &H502E       ' Resolution in height
    ' direction
    PropertyTagThumbnailPlanarConfig = &H502F      ' Image data arrangement
    PropertyTagThumbnailResolutionUnit = &H5030    ' Unit of X and Y
    ' Resolution
    PropertyTagThumbnailTransferFunction = &H5031  ' Transfer function
    PropertyTagThumbnailSoftwareUsed = &H5032      ' Software used
    PropertyTagThumbnailDateTime = &H5033          ' File change date and
    ' time
    PropertyTagThumbnailArtist = &H5034            ' Person who created the
    ' image
    PropertyTagThumbnailWhitePoint = &H5035        ' White point chromaticity
    PropertyTagThumbnailPrimaryChromaticities = &H5036
    ' Chromaticities of
    ' primaries
    PropertyTagThumbnailYCbCrCoefficients = &H5037 ' Color space transforma-
    ' tion coefficients
    PropertyTagThumbnailYCbCrSubsampling = &H5038  ' Subsampling ratio of Y
    ' to C
    PropertyTagThumbnailYCbCrPositioning = &H5039  ' Y and C position
    PropertyTagThumbnailRefBlackWhite = &H503A     ' Pair of black and white
    ' reference values
    PropertyTagThumbnailCopyRight = &H503B         ' CopyRight holder

    PropertyTagLuminanceTable = &H5090
    PropertyTagChrominanceTable = &H5091

    PropertyTagFrameDelay = &H5100
    PropertyTagLoopCount = &H5101

    PropertyTagPixelUnit = &H5110          ' Unit specifier for pixel/unit
    PropertyTagPixelPerUnitX = &H5111      ' Pixels per unit in X
    PropertyTagPixelPerUnitY = &H5112      ' Pixels per unit in Y
    PropertyTagPaletteHistogram = &H5113   ' Palette histogram

    PropertyTagExifExposureTime = &H829A
    PropertyTagExifFNumber = &H829D

    PropertyTagExifExposureProg = &H8822
    PropertyTagExifSpectralSense = &H8824
    PropertyTagExifISOSpeed = &H8827
    PropertyTagExifOECF = &H8828

    PropertyTagExifVer = &H9000
    PropertyTagExifDTOrig = &H9003         ' Date & time of original
    PropertyTagExifDTDigitized = &H9004    ' Date & time of digital data generation

    PropertyTagExifCompConfig = &H9101
    PropertyTagExifCompBPP = &H9102

    PropertyTagExifShutterSpeed = &H9201
    PropertyTagExifAperture = &H9202
    PropertyTagExifBrightness = &H9203
    PropertyTagExifExposureBias = &H9204
    PropertyTagExifMaxAperture = &H9205
    PropertyTagExifSubjectDist = &H9206
    PropertyTagExifMeteringMode = &H9207
    PropertyTagExifLightSource = &H9208
    PropertyTagExifFlash = &H9209
    PropertyTagExifFocalLength = &H920A
    PropertyTagExifMakerNote = &H927C
    PropertyTagExifUserComment = &H9286
    PropertyTagExifDTSubsec = &H9290        ' Date & Time subseconds
    PropertyTagExifDTOrigSS = &H9291        ' Date & Time original subseconds
    PropertyTagExifDTDigSS = &H9292         ' Date & TIme digitized subseconds

    PropertyTagExifFPXVer = &HA000
    PropertyTagExifColorSpace = &HA001
    PropertyTagExifPixXDim = &HA002
    PropertyTagExifPixYDim = &HA003
    PropertyTagExifRelatedWav = &HA004      ' related sound file
    PropertyTagExifInterop = &HA005
    PropertyTagExifFlashEnergy = &HA20B
    PropertyTagExifSpatialFR = &HA20C       ' Spatial Frequency Response
    PropertyTagExifFocalXRes = &HA20E       ' Focal Plane X Resolution
    PropertyTagExifFocalYRes = &HA20F       ' Focal Plane Y Resolution
    PropertyTagExifFocalResUnit = &HA210    ' Focal Plane Resolution Unit
    PropertyTagExifSubjectLoc = &HA214
    PropertyTagExifExposureIndex = &HA215
    PropertyTagExifSensingMethod = &HA217
    PropertyTagExifFileSource = &HA300
    PropertyTagExifSceneType = &HA301
    PropertyTagExifCfaPattern = &HA302

    PropertyTagGpsVer = &H0
    PropertyTagGpsLatitudeRef = &H1
    PropertyTagGpsLatitude = &H2
    PropertyTagGpsLongitudeRef = &H3
    PropertyTagGpsLongitude = &H4
    PropertyTagGpsAltitudeRef = &H5
    PropertyTagGpsAltitude = &H6
    PropertyTagGpsGpsTime = &H7
    PropertyTagGpsGpsSatellites = &H8
    PropertyTagGpsGpsStatus = &H9
    PropertyTagGpsGpsMeasureMode = &HA
    PropertyTagGpsGpsDop = &HB              ' Measurement precision
    PropertyTagGpsSpeedRef = &HC
    PropertyTagGpsSpeed = &HD
    PropertyTagGpsTrackRef = &HE
    PropertyTagGpsTrack = &HF
    PropertyTagGpsImgDirRef = &H10
    PropertyTagGpsImgDir = &H11
    PropertyTagGpsMapDatum = &H12
    PropertyTagGpsDestLatRef = &H13
    PropertyTagGpsDestLat = &H14
    PropertyTagGpsDestLongRef = &H15
    PropertyTagGpsDestLong = &H16
    PropertyTagGpsDestBearRef = &H17
    PropertyTagGpsDestBear = &H18
    PropertyTagGpsDestDistRef = &H19
    PropertyTagGpsDestDist = &H1A
  End Enum

  Public Enum PropertyTagType As Short
    PropertyTagTypeByte = 1
    PropertyTagTypeASCII = 2
    PropertyTagTypeShort = 3
    PropertyTagTypeLong = 4
    PropertyTagTypeRational = 5
    PropertyTagTypeUndefined = 7
    PropertyTagTypeSLong = 9
    PropertyTagTypeSRational = 10
  End Enum

  Public Function PropertyItem_Name(ByRef propItem As PropertyItem) As String
    Select Case propItem.Id
      Case Image_Property_ID_Tags.PropertyTagExifIFD
        Return "ExifIFD"
      Case Image_Property_ID_Tags.PropertyTagsIFD
        Return "IFD"
      Case Image_Property_ID_Tags.PropertyTagNewSubfileType
        Return "NewSubfileType"
      Case Image_Property_ID_Tags.PropertyTagSubfileType
        Return "TagSubFileType"
      Case Image_Property_ID_Tags.PropertyTagImageWidth
        Return "ImageWidth"
      Case Image_Property_ID_Tags.PropertyTagImageHeight
        Return "ImageHeight"
      Case Image_Property_ID_Tags.PropertyTagBitsPerSample
        Return "BitsPerSample"
      Case Image_Property_ID_Tags.PropertyTagCompression
        Return "Compression"
      Case Image_Property_ID_Tags.PropertyTagPhotometricInterp
        Return "PhotometricInterp"
      Case Image_Property_ID_Tags.PropertyTagThreshHolding
        Return "ThreshHolding"
      Case Image_Property_ID_Tags.PropertyTagCellWidth
        Return "CellWidth"
      Case Image_Property_ID_Tags.PropertyTagCellHeight
        Return "CellHeight"
      Case Image_Property_ID_Tags.PropertyTagFillOrder
        Return "FillOrder"
      Case Image_Property_ID_Tags.PropertyTagDocumentName
        Return "DocumentName"
      Case Image_Property_ID_Tags.PropertyTagImageDescription
        Return "ImageDescription"
      Case Image_Property_ID_Tags.PropertyTagEquipMake
        Return "EquipMake"
      Case Image_Property_ID_Tags.PropertyTagEquipModel
        Return "EquipModel"
      Case Image_Property_ID_Tags.PropertyTagStripOffsets
        Return "StripOffsets"
      Case Image_Property_ID_Tags.PropertyTagOrientation
        Return "Orientation"
      Case Image_Property_ID_Tags.PropertyTagSamplesPerPixel
        Return "SamplesPerPixel"
      Case Image_Property_ID_Tags.PropertyTagRowsPerStrip
        Return "RowsPerStrip"
      Case Image_Property_ID_Tags.PropertyTagStripBytesCount
        Return "StripBytesCount"
      Case Image_Property_ID_Tags.PropertyTagMinSampleValue
        Return "MinSampleValue"
      Case Image_Property_ID_Tags.PropertyTagMaxSampleValue
        Return "MaxSampleValue"
      Case Image_Property_ID_Tags.PropertyTagXResolution
        Return "XResolution"
      Case Image_Property_ID_Tags.PropertyTagYResolution
        Return "YResolution"
      Case Image_Property_ID_Tags.PropertyTagPlanarConfig
        Return "PlanarConfig"
      Case Image_Property_ID_Tags.PropertyTagPageName
        Return "PageName"
      Case Image_Property_ID_Tags.PropertyTagXPosition
        Return "XPosition"
      Case Image_Property_ID_Tags.PropertyTagYPosition
        Return "YPosition"
      Case Image_Property_ID_Tags.PropertyTagFreeOffset
        Return "FreeOffset"
      Case Image_Property_ID_Tags.PropertyTagFreeByteCounts
        Return "FreeByteCounts"
      Case Image_Property_ID_Tags.PropertyTagGrayResponseUnit
        Return "GrayResponseUnit"
      Case Image_Property_ID_Tags.PropertyTagGrayResponseCurve
        Return "GrayResponseCurve"
      Case Image_Property_ID_Tags.PropertyTagT4Option
        Return "T4Option"
      Case Image_Property_ID_Tags.PropertyTagT6Option
        Return "T6Option"
      Case Image_Property_ID_Tags.PropertyTagResolutionUnit
        Return "ResolutionUnit"
      Case Image_Property_ID_Tags.PropertyTagPageNumber
        Return "PageNumber"
      Case Image_Property_ID_Tags.PropertyTagTransferFuncition
        Return "TransferFuncition"
      Case Image_Property_ID_Tags.PropertyTagSoftwareUsed
        Return "SoftwareUsed"
      Case Image_Property_ID_Tags.PropertyTagDateTime
        Return "DateTime"
      Case Image_Property_ID_Tags.PropertyTagArtist
        Return "Artist"
      Case Image_Property_ID_Tags.PropertyTagHostComputer
        Return "HostComputer"
      Case Image_Property_ID_Tags.PropertyTagPredictor
        Return "Predictor"
      Case Image_Property_ID_Tags.PropertyTagWhitePoint
        Return "WhitePoint"
      Case Image_Property_ID_Tags.PropertyTagPrimaryChromaticities
        Return "PrimaryChromaticities"
      Case Image_Property_ID_Tags.PropertyTagColorMap
        Return "ColorMap"
      Case Image_Property_ID_Tags.PropertyTagHalftoneHints
        Return "HalftoneHints"
      Case Image_Property_ID_Tags.PropertyTagTileWidth
        Return "TileWidth"
      Case Image_Property_ID_Tags.PropertyTagTileLength
        Return "TileLength"
      Case Image_Property_ID_Tags.PropertyTagTileOffset
        Return "TileOffset"
      Case Image_Property_ID_Tags.PropertyTagTileByteCounts
        Return "TileByteCounts"
      Case Image_Property_ID_Tags.PropertyTagInkSet
        Return "InkSet"
      Case Image_Property_ID_Tags.PropertyTagInkNames
        Return "InkNames"
      Case Image_Property_ID_Tags.PropertyTagNumberOfInks
        Return "NumberOfInks"
      Case Image_Property_ID_Tags.PropertyTagDotRange
        Return "DotRange"
      Case Image_Property_ID_Tags.PropertyTagTargetPrinter
        Return "TargetPrinter"
      Case Image_Property_ID_Tags.PropertyTagExtraSamples
        Return "ExtraSamples"
      Case Image_Property_ID_Tags.PropertyTagSampleFormat
        Return "SampleFormat"
      Case Image_Property_ID_Tags.PropertyTagSMinSampleValue
        Return "SMinSampleValue"
      Case Image_Property_ID_Tags.PropertyTagSMaxSampleValue
        Return "SMaxSampleValue"
      Case Image_Property_ID_Tags.PropertyTagTransferRange
        Return "TransferRange"
      Case Image_Property_ID_Tags.PropertyTagJPEGProc
        Return "JPEGProc"
      Case Image_Property_ID_Tags.PropertyTagJPEGInterFormat
        Return "JPEGInterFormat"
      Case Image_Property_ID_Tags.PropertyTagJPEGInterLength
        Return "JPEGInterLength"
      Case Image_Property_ID_Tags.PropertyTagJPEGRestartInterval
        Return "JPEGRestartInterval"
      Case Image_Property_ID_Tags.PropertyTagJPEGLosslessPredictors
        Return "JPEGLosslessPredictors"
      Case Image_Property_ID_Tags.PropertyTagJPEGPointTransforms
        Return "JPEointTransforms"
      Case Image_Property_ID_Tags.PropertyTagJPEGQTables
        Return "JPEGQTables"
      Case Image_Property_ID_Tags.PropertyTagJPEGDCTables
        Return "JPEGDCTables"
      Case Image_Property_ID_Tags.PropertyTagJPEGACTables
        Return "JPEGACTables"
      Case Image_Property_ID_Tags.PropertyTagYCbCrCoefficients
        Return "YCbCrCoefficients"
      Case Image_Property_ID_Tags.PropertyTagYCbCrSubsampling
        Return "YCbCrSubsampling"
      Case Image_Property_ID_Tags.PropertyTagYCbCrPositioning
        Return "YCbCrPositioning"
      Case Image_Property_ID_Tags.PropertyTagREFBlackWhite
        Return "REFBlackWhite"
      Case Image_Property_ID_Tags.PropertyTagICCProfile
        Return "ICCProfile"
      Case Image_Property_ID_Tags.PropertyTagGamma
        Return "Gamma"
      Case Image_Property_ID_Tags.PropertyTagICCProfileDescriptor
        Return "ICCProfileDescriptor"
      Case Image_Property_ID_Tags.PropertyTagSRGBRenderingIntent
        Return "SRGBRenderingIntent"
      Case Image_Property_ID_Tags.PropertyTagImageTitle
        Return "ImageTitle"
      Case Image_Property_ID_Tags.PropertyTagCopyright
        Return "Copyright"
      Case Image_Property_ID_Tags.PropertyTagResolutionXUnit
        Return "ResolutionXUnit"
      Case Image_Property_ID_Tags.PropertyTagResolutionYUnit
        Return "ResolutionYUnit"
      Case Image_Property_ID_Tags.PropertyTagResolutionXLengthUnit
        Return "ResolutionXLengthUnit"
      Case Image_Property_ID_Tags.PropertyTagResolutionYLengthUnit
        Return "ResolutionYLengthUnit"
      Case Image_Property_ID_Tags.PropertyTagPrintFlags
        Return "PrintFlags"
      Case Image_Property_ID_Tags.PropertyTagPrintFlagsVersion
        Return "PrintFlagsVersion"
      Case Image_Property_ID_Tags.PropertyTagPrintFlagsCrop
        Return "PrintFlagsCrop"
      Case Image_Property_ID_Tags.PropertyTagPrintFlagsBleedWidth
        Return "PrintFlagsBleedWidth"
      Case Image_Property_ID_Tags.PropertyTagPrintFlagsBleedWidthScale
        Return "PrintFlagsBleedWidthScale"
      Case Image_Property_ID_Tags.PropertyTagHalftoneLPI
        Return "HalftoneLPI"
      Case Image_Property_ID_Tags.PropertyTagHalftoneLPIUnit
        Return "HalftoneLPIUnit"
      Case Image_Property_ID_Tags.PropertyTagHalftoneDegree
        Return "HalftoneDegree"
      Case Image_Property_ID_Tags.PropertyTagHalftoneShape
        Return "HalftoneShape"
      Case Image_Property_ID_Tags.PropertyTagHalftoneMisc
        Return "HalftoneMisc"
      Case Image_Property_ID_Tags.PropertyTagHalftoneScreen
        Return "HalftoneScreen"
      Case Image_Property_ID_Tags.PropertyTagJPEGQuality
        Return "JPEGQuality"
      Case Image_Property_ID_Tags.PropertyTagGridSize
        Return "GridSize"
      Case Image_Property_ID_Tags.PropertyTagThumbnailFormat
        Return "ThumbnailFormat"
      Case Image_Property_ID_Tags.PropertyTagThumbnailWidth
        Return "ThumbnailWidth"
      Case Image_Property_ID_Tags.PropertyTagThumbnailHeight
        Return "ThumbnailHeight"
      Case Image_Property_ID_Tags.PropertyTagThumbnailColorDepth
        Return "ThumbnailColorDepth"
      Case Image_Property_ID_Tags.PropertyTagThumbnailPlanes
        Return "ThumbnailPlanes"
      Case Image_Property_ID_Tags.PropertyTagThumbnailRawBytes
        Return "ThumbnailRawBytes"
      Case Image_Property_ID_Tags.PropertyTagThumbnailSize
        Return "ThumbnailSize"
      Case Image_Property_ID_Tags.PropertyTagThumbnailCompressedSize
        Return "ThumbnailCompressedSize"
      Case Image_Property_ID_Tags.PropertyTagColorTransferFunction
        Return "ColorTransferFunction"
      Case Image_Property_ID_Tags.PropertyTagThumbnailData
        Return "ThumbnailData"
      Case Image_Property_ID_Tags.PropertyTagThumbnailImageWidth
        Return "ThumbnailImageWidth"
      Case Image_Property_ID_Tags.PropertyTagThumbnailImageHeight
        Return "ThumbnailImageHeight"
      Case Image_Property_ID_Tags.PropertyTagThumbnailBitsPerSample
        Return "ThumbnailBitsPerSample"
      Case Image_Property_ID_Tags.PropertyTagThumbnailCompression
        Return "ThumbnailCompression"
      Case Image_Property_ID_Tags.PropertyTagThumbnailPhotometricInterp
        Return "ThumbnailPhotometricInterp"
      Case Image_Property_ID_Tags.PropertyTagThumbnailImageDescription
        Return "ThumbnailImageDescription"
      Case Image_Property_ID_Tags.PropertyTagThumbnailEquipMake
        Return "ThumbnailEquipMake"
      Case Image_Property_ID_Tags.PropertyTagThumbnailEquipModel
        Return "ThumbnailEquipModel"
      Case Image_Property_ID_Tags.PropertyTagThumbnailStripOffsets
        Return "ThumbnailStripOffsets"
      Case Image_Property_ID_Tags.PropertyTagThumbnailOrientation
        Return "ThumbnailOrientation"
      Case Image_Property_ID_Tags.PropertyTagThumbnailSamplesPerPixel
        Return "ThumbnailSamplesPerPixel"
      Case Image_Property_ID_Tags.PropertyTagThumbnailRowsPerStrip
        Return "ThumbnailRowsPerStrip"
      Case Image_Property_ID_Tags.PropertyTagThumbnailStripBytesCount
        Return "ThumbnailStripBytesCount"
      Case Image_Property_ID_Tags.PropertyTagThumbnailResolutionX
        Return "ThumbnailResolutionX"
      Case Image_Property_ID_Tags.PropertyTagThumbnailResolutionY
        Return "ThumbnailResolutionY"
      Case Image_Property_ID_Tags.PropertyTagThumbnailPlanarConfig
        Return "ThumbnailPlanarConfig"
      Case Image_Property_ID_Tags.PropertyTagThumbnailResolutionUnit
        Return "ThumbnailResolutionUnit"
      Case Image_Property_ID_Tags.PropertyTagThumbnailTransferFunction
        Return "ThumbnailTransferFunction"
      Case Image_Property_ID_Tags.PropertyTagThumbnailSoftwareUsed
        Return "ThumbnailSoftwareUsed"
      Case Image_Property_ID_Tags.PropertyTagThumbnailDateTime
        Return "ThumbnailDateTime"
      Case Image_Property_ID_Tags.PropertyTagThumbnailArtist
        Return "ThumbnailArtist"
      Case Image_Property_ID_Tags.PropertyTagThumbnailWhitePoint
        Return "ThumbnailWhitePoint"
      Case Image_Property_ID_Tags.PropertyTagThumbnailPrimaryChromaticities
        Return "ThumbnailPrimaryChromaticities"
      Case Image_Property_ID_Tags.PropertyTagThumbnailYCbCrCoefficients
        Return "ThumbnailYCbCrCoefficients"
      Case Image_Property_ID_Tags.PropertyTagThumbnailYCbCrSubsampling
        Return "ThumbnailYCbCrSubsampling"
      Case Image_Property_ID_Tags.PropertyTagThumbnailYCbCrPositioning
        Return "ThumbnailYCbCrPositioning"
      Case Image_Property_ID_Tags.PropertyTagThumbnailRefBlackWhite
        Return "ThumbnailRefBlackWhite"
      Case Image_Property_ID_Tags.PropertyTagThumbnailCopyRight
        Return "ThumbnailCopyRight"
      Case Image_Property_ID_Tags.PropertyTagLuminanceTable
        Return "LuminanceTable"
      Case Image_Property_ID_Tags.PropertyTagChrominanceTable
        Return "ChrominanceTable"
      Case Image_Property_ID_Tags.PropertyTagFrameDelay
        Return "FrameDelay"
      Case Image_Property_ID_Tags.PropertyTagLoopCount
        Return "LoopCount"
      Case Image_Property_ID_Tags.PropertyTagPixelUnit
        Return "PixelUnit"
      Case Image_Property_ID_Tags.PropertyTagPixelPerUnitX
        Return "PixelPerUnitX"
      Case Image_Property_ID_Tags.PropertyTagPixelPerUnitY
        Return "PixelPerUnitY"
      Case Image_Property_ID_Tags.PropertyTagPaletteHistogram
        Return "PaletteHistogram"
      Case Image_Property_ID_Tags.PropertyTagExifExposureTime
        Return "ExifExposureTime"
      Case Image_Property_ID_Tags.PropertyTagExifFNumber
        Return "ExifFNumber"
      Case Image_Property_ID_Tags.PropertyTagExifExposureProg
        Return "ExifExposureProg"
      Case Image_Property_ID_Tags.PropertyTagExifSpectralSense
        Return "ExifSpectralSense"
      Case Image_Property_ID_Tags.PropertyTagExifISOSpeed
        Return "ExifISOSpeed"
      Case Image_Property_ID_Tags.PropertyTagExifOECF
        Return "ExifOECF"
      Case Image_Property_ID_Tags.PropertyTagExifVer
        Return "ExifVer"
      Case Image_Property_ID_Tags.PropertyTagExifDTOrig
        Return "ExifDTOrig"
      Case Image_Property_ID_Tags.PropertyTagExifDTDigitized
        Return "ExifDTDigitized"
      Case Image_Property_ID_Tags.PropertyTagExifCompConfig
        Return "ExifCompConfig"
      Case Image_Property_ID_Tags.PropertyTagExifCompBPP
        Return "ExifCompBPP"
      Case Image_Property_ID_Tags.PropertyTagExifShutterSpeed
        Return "ExifShutterSpeed"
      Case Image_Property_ID_Tags.PropertyTagExifAperture
        Return "ExifAperture"
      Case Image_Property_ID_Tags.PropertyTagExifBrightness
        Return "ExifBrightness"
      Case Image_Property_ID_Tags.PropertyTagExifExposureBias
        Return "ExifExposureBias"
      Case Image_Property_ID_Tags.PropertyTagExifMaxAperture
        Return "ExifMaxAperture"
      Case Image_Property_ID_Tags.PropertyTagExifSubjectDist
        Return "ExifSubjectDist"
      Case Image_Property_ID_Tags.PropertyTagExifMeteringMode
        Return "ExifMeteringMode"
      Case Image_Property_ID_Tags.PropertyTagExifLightSource
        Return "ExifLightSource"
      Case Image_Property_ID_Tags.PropertyTagExifFlash
        Return "ExifFlash"
      Case Image_Property_ID_Tags.PropertyTagExifFocalLength
        Return "ExifFocalLength"
      Case Image_Property_ID_Tags.PropertyTagExifMakerNote
        Return "ExifMakerNote"
      Case Image_Property_ID_Tags.PropertyTagExifUserComment
        Return "ExifUserComment"
      Case Image_Property_ID_Tags.PropertyTagExifDTSubsec
        Return "ExifDTSubsec"
      Case Image_Property_ID_Tags.PropertyTagExifDTOrigSS
        Return "ExifDTOrigSS"
      Case Image_Property_ID_Tags.PropertyTagExifDTDigSS
        Return "ExifDTDigSS"
      Case Image_Property_ID_Tags.PropertyTagExifFPXVer
        Return "ExifFPXVer"
      Case Image_Property_ID_Tags.PropertyTagExifColorSpace
        Return "ExifColorSpace"
      Case Image_Property_ID_Tags.PropertyTagExifPixXDim
        Return "ExifPixXDim"
      Case Image_Property_ID_Tags.PropertyTagExifPixYDim
        Return "ExifPixYDim"
      Case Image_Property_ID_Tags.PropertyTagExifRelatedWav
        Return "ExifRelatedWav"
      Case Image_Property_ID_Tags.PropertyTagExifInterop
        Return "ExifInterop"
      Case Image_Property_ID_Tags.PropertyTagExifFlashEnergy
        Return "ExifFlashEnergy"
      Case Image_Property_ID_Tags.PropertyTagExifSpatialFR
        Return "ExifSpatialFR"
      Case Image_Property_ID_Tags.PropertyTagExifFocalXRes
        Return "ExifFocalXRes"
      Case Image_Property_ID_Tags.PropertyTagExifFocalYRes
        Return "ExifFocalYRes"
      Case Image_Property_ID_Tags.PropertyTagExifFocalResUnit
        Return "ExifFocalResUnit"
      Case Image_Property_ID_Tags.PropertyTagExifSubjectLoc
        Return "ExifSubjectLoc"
      Case Image_Property_ID_Tags.PropertyTagExifExposureIndex
        Return "ExifExposureIndex"
      Case Image_Property_ID_Tags.PropertyTagExifSensingMethod
        Return "ExifSensingMethod"
      Case Image_Property_ID_Tags.PropertyTagExifFileSource
        Return "ExifFileSource"
      Case Image_Property_ID_Tags.PropertyTagExifSceneType
        Return "ExifSceneType"
      Case Image_Property_ID_Tags.PropertyTagExifCfaPattern
        Return "ExifCfaPattern"
      Case Image_Property_ID_Tags.PropertyTagGpsVer
        Return "GpsVer"
      Case Image_Property_ID_Tags.PropertyTagGpsLatitudeRef
        Return "GpsLatitudeRef"
      Case Image_Property_ID_Tags.PropertyTagGpsLatitude
        Return "GpsLatitude"
      Case Image_Property_ID_Tags.PropertyTagGpsLongitudeRef
        Return "GpsLongitudeRef"
      Case Image_Property_ID_Tags.PropertyTagGpsLongitude
        Return "GpsLongitude"
      Case Image_Property_ID_Tags.PropertyTagGpsAltitudeRef
        Return "GpsAltitudeRef"
      Case Image_Property_ID_Tags.PropertyTagGpsAltitude
        Return "GpsAltitude"
      Case Image_Property_ID_Tags.PropertyTagGpsGpsTime
        Return "GpsGpsTime"
      Case Image_Property_ID_Tags.PropertyTagGpsGpsSatellites
        Return "GpsGpsSatellites"
      Case Image_Property_ID_Tags.PropertyTagGpsGpsStatus
        Return "GpsGpsStatus"
      Case Image_Property_ID_Tags.PropertyTagGpsGpsMeasureMode
        Return "GpsGpsMeasureMode"
      Case Image_Property_ID_Tags.PropertyTagGpsGpsDop
        Return "GpsGpsDop"
      Case Image_Property_ID_Tags.PropertyTagGpsSpeedRef
        Return "GpsSpeedRef"
      Case Image_Property_ID_Tags.PropertyTagGpsSpeed
        Return "GpsSpeed"
      Case Image_Property_ID_Tags.PropertyTagGpsTrackRef
        Return "GpsTrackRef"
      Case Image_Property_ID_Tags.PropertyTagGpsTrack
        Return "GpsTrack"
      Case Image_Property_ID_Tags.PropertyTagGpsImgDirRef
        Return "GpsImgDirRef"
      Case Image_Property_ID_Tags.PropertyTagGpsImgDir
        Return "GpsImgDir"
      Case Image_Property_ID_Tags.PropertyTagGpsMapDatum
        Return "GpsMapDatum"
      Case Image_Property_ID_Tags.PropertyTagGpsDestLatRef
        Return "GpsDestLatRef"
      Case Image_Property_ID_Tags.PropertyTagGpsDestLat
        Return "GpsDestLat"
      Case Image_Property_ID_Tags.PropertyTagGpsDestLongRef
        Return "GpsDestLongRef"
      Case Image_Property_ID_Tags.PropertyTagGpsDestLong
        Return "GpsDestLong"
      Case Image_Property_ID_Tags.PropertyTagGpsDestBearRef
        Return "GpsDestBearRef"
      Case Image_Property_ID_Tags.PropertyTagGpsDestBear
        Return "GpsDestBear"
      Case Image_Property_ID_Tags.PropertyTagGpsDestDistRef
        Return "GpsDestDistRef"
      Case Image_Property_ID_Tags.PropertyTagGpsDestDist
        Return "GpsDestDist"
      Case Else
        Return ""
    End Select

  End Function

  Public Function PropertyItem_ValueCount(ByRef propItem As PropertyItem) As Integer
    Select Case propItem.Type
      Case PropertyTagType.PropertyTagTypeASCII
        ' each item is 1 byte:
        Return 1
      Case PropertyTagType.PropertyTagTypeUndefined, PropertyTagType.PropertyTagTypeByte, 6 ' sbyte
        Return propItem.Len
      Case PropertyTagType.PropertyTagTypeShort, 8 ' schar
        ' each item is 2 bytes:
        Return propItem.Len / 2
      Case PropertyTagType.PropertyTagTypeRational, PropertyTagType.PropertyTagTypeSRational, 12 ' double
        ' each item is 8 bytes:
        Return propItem.Len / 8
      Case PropertyTagType.PropertyTagTypeLong, PropertyTagType.PropertyTagTypeSLong, 11 ' float
        ' each item is 4 bytes:
        Return propItem.Len / 4
      Case Else
        Return 0
    End Select
  End Function

  Public Function PropertyItem_ParseString(ByRef propItem As PropertyItem) As String
    Dim enc As New System.Text.ASCIIEncoding()
    Return enc.GetString(propItem.Value, 0, propItem.Len - 1)
  End Function

  Public Function PropertyItem_ParseRational(ByRef propItem As PropertyItem, ByVal lItem As Integer) As Object
    Dim lStart As Integer
    If (lItem > 0) And (lItem <= PropertyItem_ValueCount(propItem)) Then
      lStart = (lItem - 1) * 8
      Dim lValue(0 To 1) As Integer
      lValue(0) = BitConverter.ToInt32(propItem.Value, lStart)
      lValue(1) = BitConverter.ToInt32(propItem.Value, lStart + 4)
      Return lValue
    Else
      'SetStatusHelper InvalidParameter
      Return Nothing
    End If
  End Function

  Public Function PropertyItem_ParseShort(ByRef propItem As PropertyItem, ByVal lItem As Integer) As Short
    Dim lStart As Integer
    If (lItem > 0) And (lItem <= PropertyItem_ValueCount(propItem)) Then
      lStart = (lItem - 1) * 2
      Dim iRet As Short = BitConverter.ToInt16(propItem.Value, lStart)
      Return iRet
    Else
      'SetStatusHelper InvalidParameter
      Return 0
    End If
  End Function

  Public Function PropertyItem_ParseLong(ByRef propItem As PropertyItem, ByVal lItem As Integer) As Integer
    Dim lStart As Integer
    If (lItem > 0) And (lItem <= PropertyItem_ValueCount(propItem)) Then
      lStart = (lItem - 1) * 4
      Dim iRet As Integer = BitConverter.ToInt32(propItem.Value, lStart)
      Return iRet
    Else
      'SetStatusHelper InvalidParameter
      Return 0
    End If
  End Function

End Module

...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Как в .Net выкапывать свойства и значения из PropertyItems GDI+-совместимого файла?
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]