コード例 #1
0
        private Dictionary <int, string> GetAllowablePixelTypes()
        {
            var pixelTypesVector = _twain32.GetPixelTypes();

            if (pixelTypesVector == null)
            {
                return(null);
            }

            var allowablePixelTypes = new Dictionary <int, string>();

            foreach (var pixelType in pixelTypesVector.Items)
            {
                var key   = (int)(TwPixelType)pixelType;
                var value = (GlobalDictionaries.PixelTypes.ContainsKey((TwPixelType)pixelType)
                                        ? GlobalDictionaries.PixelTypes[(TwPixelType)pixelType]
                                        : pixelType.ToString());

                allowablePixelTypes.Add(key, value);
            }

            return(allowablePixelTypes);
        }