Example #1
0
        /// <summary>
        /// 获取当前实际图片个数
        /// </summary>
        /// <returns>图片个数</returns>
        public List <SVBitmap> imageArray()
        {
            List <SVBitmap> result = new List <SVBitmap>();

            if (BitmapArray == null)
            {
                return(result);
            }

            for (int i = 0; i < BitmapArray.Count; i++)
            {
                SVBitmap vTmp = BitmapArray[i];
                if (vTmp == null)
                {
                    continue;
                }

                if (!vTmp.isValidShow())
                {
                    continue;
                }

                result.Add(vTmp);
            }

            return(result);
        }
Example #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return(null);
            }

            SVBitmap bitmap = value as SVBitmap;

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

            String infile = System.IO.Path.Combine(SVProData.IconPath, "icon.proj");
            SVPixmapElementManage manage = new SVPixmapElementManage();

            manage.loadElementFromFile(infile);

            String       file1  = System.IO.Path.Combine(SVProData.IconPath, manage.getFilePathFromName(bitmap.ShowName));
            SVPixmapFile pixmap = new SVPixmapFile();

            pixmap.readPixmapFile(file1);
            System.Drawing.Image  srcImg  = System.Drawing.Image.FromStream(pixmap.Pixmap);
            System.Drawing.Bitmap oBitmap = new System.Drawing.Bitmap(srcImg);

            return(BitmapToBitmapImage(oBitmap));
        }
Example #3
0
        /// <summary>
        /// 重写父类,这里不需要关注
        /// </summary>
        /// <param oldName="context"></param>
        /// <param oldName="sourceType"></param>
        /// <returns></returns>
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            SVBitmap bitmap = value as SVBitmap;

            if (bitmap == null)
            {
                return(base.ConvertTo(context, culture, value, destinationType));
            }

            return(bitmap.ShowName);
        }
Example #4
0
        /// <summary>
        /// 重写父类,这里不需要关注
        /// </summary>
        /// <param oldName="context"></param>
        /// <param oldName="sourceType"></param>
        /// <returns></returns>
        public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
        {
            ///如果为SVBitmap对象,才执行父类操作
            SVBitmap bitmap = value as SVBitmap;

            if (bitmap == null)
            {
                return(base.ConvertFrom(context, culture, value));
            }

            return(bitmap);
        }