Example #1
0
        /// <summary>
        /// 双击图片项事件
        /// </summary>
        /// <param oldName="sender"></param>
        /// <param oldName="e"></param>
        void listView_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewItem item     = listView.SelectedItems[0];
            String       timeFile = _pixmapManage.getFilePathFromName(item.Text);

            ///组织一个选中图元后的图片对象
            SvBitMap.ShowName      = item.Text;
            SvBitMap.ImageFileName = timeFile;

            this.DialogResult = System.Windows.Forms.DialogResult.Yes;
        }
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="oldName"></param>
        /// <returns></returns>
        private Node createNodeFromName(String fileName)
        {
            String name = Path.GetFileNameWithoutExtension(fileName);

            Node node = new Node();

            node.Name     = name;
            node.ShowName = String.Format("名称:{0}", name);

            String timeFile       = _picManager.getFilePathFromName(name);
            String file           = System.IO.Path.Combine(SVProData.IconPath, timeFile);
            String fileCreateTime = File.GetCreationTime(file).ToString();

            node.File = String.Format("创建时间:{0}", fileCreateTime);

            return(node);
        }