找回密码
 立即注册

QQ登录

只需一步,快速开始

deny2016

中级会员

61

主题

386

帖子

693

积分

中级会员

积分
693

微信认证勋章

deny2016
中级会员   /  发表于:2016-8-26 13:36  /   查看:3049  /  回复:5

        private void RotateDocument(int angle)
        {
            ImageViewer imageViewer=null;
            if(combineParameter.isCombineStatus)
            {
                if(combineParameter.selectedIndex>=0)
                {
                    imageViewer = (ImageViewer)CombineTableLayoutPanel.Controls[combineParameter.selectedIndex];
                }
            }
            else
            {
                int viewCount = tableLayoutPanelColumnCount * tableLayoutPanelRowCount;
                int index = 0;
                if(viewCount>1)
                {
                    index = CurrentPageIndex % viewCount;
                }

                imageViewer = (ImageViewer)tableLayoutPanel.Controls[index];
            }

            if (/*imageViewer2*/imageViewer.Image == null) return;
          // RotateCommand rotateCommand = new RotateCommand(angle * 100, RotateCommandFlags.Resize, new RasterColor(255, 255, 255));
            try
            {
                using (WaitCursor waitCursor = new WaitCursor())
                {
                    //缓存图片处理
                    _cacheNumber = CurrentPageIndex;
                    if (_cacheImageList.Count < 6)
                    {
                        _cacheImageList.Add(imageViewer.Image.Clone());
                    }
                    else
                    {
                        _cacheImageList.RemoveAt(1);
                        _cacheImageList.Add(imageViewer.Image.Clone());
                    }
                    ImageProcessing imageProcessing = new ImageProcessing();
                    imageProcessing.RotateDocument(angle, imageViewer.Image);
                    //rotateCommand.Run(imageViewer2.Image);
                    //_ocrPage.SetRasterImage(imageViewer2.Image);
                    string filename = _tempFilePath + (CurrentPageIndex + 1).ToString() + ".tif";
                    _codecs.Save(imageViewer.Image, filename, RasterImageFormat.CcittGroup4, 1);
                }
            }
            catch (Exception)
            {
                MessageBox.Show("系统出错");
            }
            finally
            {
                UpdateOneThumbnail();
                //UpdateLeftPanle();
            }
        }

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

评分

参与人数 1金币 +300 收起 理由
gw0506 + 300 很给力!

查看全部评分

7 个回复

倒序浏览
deny2016
中级会员   /  发表于:2016-8-26 17:47:27
沙发
自己解决了,旋转之后用flipcommand又做了一下翻转
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-8-26 17:50:41
板凳
你的功力逐渐深厚了啊!
送你300金币,凑个整。
多攒点金币换礼品哈~
回复 使用道具 举报
deny2016
中级会员   /  发表于:2016-8-27 08:58:00
地板
谢谢,以后多送金币哈
回复 使用道具 举报
deny2016
中级会员   /  发表于:2016-8-27 11:07:37
5#
刚打开项目的时候提示这个错误什么意思?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
gw0506
超级版主   /  发表于:2016-8-28 22:37:25
6#
VS的问题,你可以去MSDN查找原因。
你选否就行了,以后不会出现了。

点评

发表于 2016-9-2 16:55
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部