zhao
2021-06-24 02ca96debc6056275d58e55d97f7885a195542d0
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace HH.WMS.Utils.ExcelLibrary.BinaryDrawingFormat
{
    public static class BlipType
    {
        public const byte ERROR = 0;
        public const byte UNKNOWN = 1;
        public const byte EMF = 2;
        public const byte WMF = 3;
        public const byte PICT = 4;
        public const byte JPEG = 5;
        public const byte PNG = 6;
        public const byte DIB = 7;
 
        public static byte FromImageFormat(ushort imageForamt)
        {
            switch (imageForamt)
            {
                case EscherRecordType.MsofbtBlipMetafileEMF:
                    return BlipType.EMF;
                case EscherRecordType.MsofbtBlipMetafileWMF:
                    return BlipType.WMF;
                case EscherRecordType.MsofbtBlipMetafilePICT:
                    return BlipType.PICT;
                case EscherRecordType.MsofbtBlipBitmapJPEG:
                    return BlipType.JPEG;
                case EscherRecordType.MsofbtBlipBitmapPNG:
                    return BlipType.PNG;
                case EscherRecordType.MsofbtBlipBitmapDIB:
                    return BlipType.DIB;
                default:
                    return BlipType.UNKNOWN;
            }
        }
    }
}