资源简介

这个控件用于浏览图片,可以实现图片的缩放、移动、与滚动条的配合等功能,基本满足了图片浏览的一般功能。 控件的使用可以参见我的空间:http://student.csdn.net/space.php?uid=127131&do=blog&id=19295 控件功能: 1、通过拖拽滚动条实现图片移动; 2、滚动鼠标滚轮轮实现图片上下移动; 3、按住Shift键滚动鼠标滚轮实现图片左右移动; 4、按住Ctrl键滚动鼠标滚轮实现图片的缩放。 5、通过设置isMove=True是鼠标具有拖拽图片功能。 6、控件缩放时自动调整图片在合适的位置。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;

namespace KaiwaProjects
{
    public class GifImage
    {
        private KpImageViewer KpViewer;
        private Image gif;
        private frameDimension dimension;
        private int frameCount;
        private int rotation = 0;
        private Bitmap currentframeBmp = null;

        public GifImage(KpImageViewer KpViewer Image img)
        {
            this.KpViewer = KpViewer;
            this.gif = img;
            this.dimension = new frameDimension(gif.frameDimensionsList[0]);
            this.frameCount = gif.GetframeCount(dimension);

            this.gif.SelectActiveframe(dimension 0);

            this.currentframeBmp = (Bitmap)gif.Clone();

            UpdateAnimator();
        }

        public void UpdateAnimator()
        {
            if (KpViewer.GifAnimation)
            {
                ImageAnimator.Animate(this.gif OnframeChanged);
            }
            else
            {
                ImageAnimator.StopAnimate(this.gif OnframeChanged);
            }
        }

        public int Rotation
        {
            get { return rotation; }
        }

        public void Rotate(int rotation)
        {
            this.rotation = (this.rotation + rotation) % 360;
        }

        public void Dispose()
        {
            gif.Dispose();
        }

        private void OnframeChanged(object o EventArgs e)
        {
            this.currentframeBmp = (Bitmap)gif;

            this.KpViewer.InvalidatePanel();
        }

        public Bitmap Currentframe
        {
            get
            {
                return currentframeBmp;
            }
        }

        public int frameCount
        {
            get { return frameCount; }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      59392  2011-09-14 15:02  17869351KpImageViewerV2_140_src\bin\Release\KP-ImageViewerV2.dll

     文件      95744  2011-09-14 15:02  17869351KpImageViewerV2_140_src\bin\Release\KP-ImageViewerV2.pdb

     文件       1912  2011-08-02 15:27  17869351KpImageViewerV2_140_src\GifImage.cs

     文件       3084  2010-04-14 10:30  17869351KpImageViewerV2_140_src\KP-DrawEngine.cs

     文件      47889  2011-08-02 15:41  17869351KpImageViewerV2_140_src\KP-Drawobject.cs

     文件      38803  2011-08-02 15:55  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.cs

     文件       5893  2011-08-02 15:28  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.csproj

     文件        452  2010-04-14 11:05  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.csproj.user

     文件      18510  2010-05-05 09:21  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.Designer.cs

     文件       5814  2010-05-05 09:21  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.resx

     文件       2603  2011-09-14 15:06  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.sln

    ..A..H.     41472  2011-09-14 15:06  17869351KpImageViewerV2_140_src\KP-ImageViewerV2.suo

     文件       3804  2010-06-21 19:07  17869351KpImageViewerV2_140_src\MultiPageImage.cs

     文件       6192  2011-09-14 15:16  17869351KpImageViewerV2_140_src\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache

     文件       2056  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\GenerateResource-ResGen.read.1.tlog

     文件        680  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\GenerateResource-ResGen.write.1.tlog

     文件          2  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\GenerateResource.read.1.tlog

     文件        180  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\KaiwaProjects.KpImageViewer.resources

     文件      15488  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\KaiwaProjects.Properties.Resources.resources

     文件       1040  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\KP-ImageViewerV2.csproj.FileListAbsolute.txt

     文件      59392  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\KP-ImageViewerV2.dll

     文件      95744  2011-09-14 15:02  17869351KpImageViewerV2_140_src\obj\Release\KP-ImageViewerV2.pdb

     文件       5632  2011-09-14 15:00  17869351KpImageViewerV2_140_src\obj\Release\TempPE\Properties.Resources.Designer.cs.dll

     文件        250  2010-02-03 14:44  17869351KpImageViewerV2_140_src\PanelDoubleBuffered.cs

     文件       1472  2011-08-02 16:00  17869351KpImageViewerV2_140_src\Properties\AssemblyInfo.cs

     文件       5685  2010-04-29 16:21  17869351KpImageViewerV2_140_src\Properties\Resources.Designer.cs

     文件       8833  2010-04-29 16:21  17869351KpImageViewerV2_140_src\Properties\Resources.resx

     文件        604  2010-04-29 16:21  17869351KpImageViewerV2_140_src\Resources\btnBack.png

     文件        221  2010-04-29 16:21  17869351KpImageViewerV2_140_src\Resources\btnDrag.png

     文件        846  2010-04-29 16:20  17869351KpImageViewerV2_140_src\Resources\btnFitToScreen.png

............此处省略60个文件信息

评论

共有 条评论