当前位置: 首页>>代码示例>>C#>>正文


C# RotateFlipType类代码示例

本文整理汇总了C#中RotateFlipType的典型用法代码示例。如果您正苦于以下问题:C# RotateFlipType类的具体用法?C# RotateFlipType怎么用?C# RotateFlipType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RotateFlipType类属于命名空间,在下文中一共展示了RotateFlipType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AnalyseLayout_RotatedImage

 public void AnalyseLayout_RotatedImage(RotateFlipType? rotation)
 {
     using (var img = new Bitmap(@".\phototest.tif")) {
         if (rotation.HasValue) img.RotateFlip(rotation.Value);
         engine.DefaultPageSegMode = PageSegMode.AutoOsd;
         using (var page = engine.Process(img)) {
             using (var pageLayout = page.GetIterator()) {
                 pageLayout.Begin();
                 do {
                     var result = pageLayout.GetProperties();
                     // Note: The orientation always seem to be 'PageUp' in Tesseract 3.02 according to this test.
                     Assert.That(result.Orientation, Is.EqualTo(Orientation.PageUp));
                     if (rotation == RotateFlipType.Rotate180FlipNone) {
                         // This isn't correct...
                         Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.LeftToRight));
                         Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.TopToBottom));
                     } else if (rotation == RotateFlipType.Rotate90FlipNone) {
                         Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.TopToBottom));
                         Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.RightToLeft));
                     } else if (rotation == null) {
                         Assert.That(result.WritingDirection, Is.EqualTo(WritingDirection.LeftToRight));
                         Assert.That(result.TextLineOrder, Is.EqualTo(TextLineOrder.TopToBottom));
                     }
                     // Not sure...
                 } while (pageLayout.Next(PageIteratorLevel.Block));
             }
         }
     }
 }
开发者ID:Picazsoo,项目名称:tesseract,代码行数:29,代码来源:AnalyseResultTests.cs

示例2: addimage

        protected override void addimage(location state, Brand brand, RotateFlipType rotate)
        {
            Bitmap bitmap;
            // �p�G�O�i�����P�N�]�w��ܵP���ϫ��A�_�h�N��ܪ��ߪ��P Resources.upbarnd
            if (brand.IsCanSee || state == location.South || ShowAll)
                bitmap = new Bitmap(brand.image);
            else
                bitmap = new Bitmap(Resources.upbarnd);
            // �]�w�P
            BrandBox tempBrandbox = new BrandBox(brand);

            // �]�w�۰��Y��
            tempBrandbox.SizeMode = PictureBoxSizeMode.AutoSize;

            // �]�w��Z
            tempBrandbox.Margin = new Padding(0);
            tempBrandbox.Padding = new Padding(padding);

            // �n�઺����
            bitmap.RotateFlip(rotate);

            // ����
            if (ShowAll && ShowBrandInfo)
                tempBrandbox.Click += new EventHandler(debug_Click);

            // �ƹ��ƥ�
            if (
                state == location.South
                && brand.getClass() != Settings.Default.Flower
                && brand.Team < 1
                )
            {
                tempBrandbox.MouseMove += new MouseEventHandler(tempBrandbox_MouseMove);
                tempBrandbox.MouseLeave += new EventHandler(brandBox_MouseLeave);
                tempBrandbox.Click += new EventHandler(brandBox_MouseClick);

                // �@���ƥ�
                //if (ShowAll && ShowBrandInfo)
                //    tempBrandbox.MouseHover += new EventHandler(debug_Click);
                //else
                //    tempBrandbox.MouseHover -= new EventHandler(debug_Click);
            }
            else if (cheat && state != location.South)
            {
                tempBrandbox.MouseClick += new MouseEventHandler(cheat_MouseClick);
            }
            else
            {
                tempBrandbox.Click -= new EventHandler(brandBox_MouseClick);
                tempBrandbox.MouseClick -= new MouseEventHandler(cheat_MouseClick);

            }
            bitmap = ResizeBitmap(bitmap, Settings.Default.ResizePercentage);

            // �]�w�Ϥ�
            tempBrandbox.Image = bitmap;

            // �s�W�ܱ��
            add_flowLayoutBrands(state, tempBrandbox);
        }
开发者ID:billteng,项目名称:mahjong,代码行数:60,代码来源:NewTable.cs

示例3: GetFlipTypeRotatedCW

 public static RotateFlipType GetFlipTypeRotatedCW(RotateFlipType currentRotation)
 {
     RotateFlipType newRotation;
     switch (currentRotation)
     {
         case RotateFlipType.RotateNoneFlipNone:
             newRotation = RotateFlipType.Rotate90FlipNone;
             break;
         case RotateFlipType.Rotate90FlipNone:
             newRotation = RotateFlipType.Rotate180FlipNone;
             break;
         case RotateFlipType.Rotate180FlipNone:
         case RotateFlipType.RotateNoneFlipY: // legacy images
             newRotation = RotateFlipType.Rotate270FlipNone;
             break;
         case RotateFlipType.Rotate270FlipNone:
             newRotation = RotateFlipType.RotateNoneFlipNone;
             break;
         default:
             Debug.Fail("Unknown RotateFlipType encountered: " + currentRotation.ToString());
             newRotation = RotateFlipType.RotateNoneFlipNone;
             break;
     }
     return newRotation;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:25,代码来源:ImageDecoratorUtils.cs

示例4: RotateFlip

 public static Bitmap RotateFlip(RotateFlipType rotateFlipType, Bitmap input)
 {
     Bitmap temp = input;
     Bitmap bmap = (Bitmap)temp.Clone();
     bmap.RotateFlip(rotateFlipType);
     return (Bitmap)bmap.Clone();
 }
开发者ID:hmaster20,项目名称:mRemoteNC,代码行数:7,代码来源:Tools.Misc.cs

示例5: RotateFlip

 public void RotateFlip(RotateFlipType rotateFlipType)
 {
     Bitmap temp = (Bitmap)m_CurrentImage;
     Bitmap bmap = (Bitmap)temp.Clone();
     bmap.RotateFlip(rotateFlipType);
     m_CurrentImage = (Bitmap)bmap.Clone();
 }
开发者ID:idomic,项目名称:Design_Patterns,代码行数:7,代码来源:ImageProcessing.cs

示例6: Resize

        /// <summary>
        /// Resizes and rotates an image, keeping the original aspect ratio. Does not dispose the original
        /// Image instance.
        /// </summary>
        /// <param name="image">Image instance</param>
        /// <param name="width">desired width</param>
        /// <param name="height">desired height</param>
        /// <param name="rotateFlipType">desired RotateFlipType</param>
        /// <returns>new resized/rotated Image instance</returns>
        public static System.Drawing.Image Resize(System.Drawing.Image image, int width, 
            int height, RotateFlipType rotateFlipType)
        {
            // clone the Image instance, since we don't want to resize the original Image instance
            var rotatedImage = image.Clone() as System.Drawing.Image;
            //rotatedImage.RotateFlip(rotateFlipType);
            var newSize = CalculateResizedDimensions(rotatedImage, width, height);

            var resizedImage = new Bitmap(newSize.Width, newSize.Height, PixelFormat.Format32bppArgb);
            resizedImage.SetResolution(72, 72);

            using (var graphics = Graphics.FromImage(resizedImage))
            {
                // set parameters to create a high-quality thumbnail
                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                graphics.SmoothingMode = SmoothingMode.AntiAlias;
                graphics.CompositingQuality = CompositingQuality.HighQuality;
                graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;

                // use an image attribute in order to remove the black/gray border around image after resize
                // (most obvious on white images), see this post for more information:
                // http://www.codeproject.com/KB/GDI-plus/imgresizoutperfgdiplus.aspx
                using (var attribute = new ImageAttributes())
                {
                    attribute.SetWrapMode(WrapMode.TileFlipXY);

                    // draws the resized image to the bitmap
                    graphics.DrawImage(rotatedImage, new Rectangle(new Point(0, 0), newSize), 0, 0, rotatedImage.Width, rotatedImage.Height, GraphicsUnit.Pixel, attribute);
                }
            }

            return resizedImage;
        }
开发者ID:tonousa,项目名称:HtmlEmails,代码行数:42,代码来源:WebForm.aspx.cs

示例7: RotateTool

        public RotateTool(IDrawingFeatures drawingFeatures, RotateFlipType rotateType)
        {
            _drawingFeatures = drawingFeatures;
            _rotateType = rotateType;

            _drawingFeatures.DrawingHistory.CanceledShares = new Stack<AUndoable>();
            _previousImage = (Bitmap)_drawingFeatures.PaintingArea.Image.Clone();
        }
开发者ID:mgorski-zlatan,项目名称:Paint,代码行数:8,代码来源:RotateTool.cs

示例8: Rotate

 // Modified behavior
 public void Rotate(RotateFlipType rotation, IEnumerable<Bitmap> images)
 {
     if (decorated == null)
         return;
     Parallel.ForEach(images, b =>
         {
             b.RotateFlip(rotation);
         });
 }
开发者ID:arthis,项目名称:parallelPatterns,代码行数:10,代码来源:Decorator.cs

示例9: RotationatePathIfNeeded

        public static bool RotationatePathIfNeeded(string path, RotateFlipType type)
        {
            if (type == RotateFlipType.RotateNoneFlipNone)
                return false;

            var bmp = Bitmap.FromFile (path);
            bmp.RotateFlip (type);
            bmp.Save (path);

            return true;
        }
开发者ID:garuma,项目名称:apachai,代码行数:11,代码来源:Rotationner.cs

示例10: IsRotated90

 public static bool IsRotated90(RotateFlipType rotation)
 {
     switch (rotation)
     {
         case RotateFlipType.Rotate90FlipNone:
         case RotateFlipType.Rotate90FlipX:
         case RotateFlipType.Rotate90FlipXY:
         case RotateFlipType.Rotate90FlipY:
             return true;
         default:
             return false;
     }
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:13,代码来源:ImageUtils.cs

示例11: RotateImage

        public static Image RotateImage(Image img, RotateFlipType type)
        {
            var bmp = new Bitmap(img);

            using (Graphics gfx = Graphics.FromImage(bmp))
            {
                gfx.Clear(Color.White);
                gfx.DrawImage(img, 0, 0, img.Width, img.Height);
            }

            bmp.RotateFlip(type);
            return bmp;
        }
开发者ID:Apidcloud,项目名称:ProjectoSueca,代码行数:13,代码来源:ImageUtilities.cs

示例12: DrawTile

        private int DrawTile(int Tile, int X, int Y, RotateFlipType Rotate)
        {
            Paifu.PaifuTileImage TileImage = new Paifu.PaifuTileImage(Tile, Scale, Red);
            Bitmap TileBitmap = TileImage.Bmp;

            switch (Rotate)
            {
                case RotateFlipType.Rotate90FlipNone: TileBitmap.RotateFlip(Rotate); Y += (TileHeight - TileWidth); break;
                case RotateFlipType.Rotate270FlipNone: TileBitmap.RotateFlip(Rotate); Y += (TileHeight - TileWidth); break;
            }

            G.DrawImage(TileBitmap, new Point(X, Y));

            return TileBitmap.Width;
        }
开发者ID:nwalker,项目名称:tenhouviewer,代码行数:15,代码来源:HandOutput.cs

示例13: CScanViewer

        public CScanViewer()
        {
            InitializeComponent();

            this.Location = new Point(10, 10);
            this.Size = new Size(10, 10);
            this.Visible = true;
            rotate = RotateFlipType.Rotate90FlipNone;       // RotateFlipType.Rotate90FlipXY
            frameSize = new Size(0, 0);

            this.NewFrame += new AForge.Controls.VideoSourcePlayer.NewFrameHandler(frameHandler);
            this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.mouseDownHandler);
            this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.mouseUpHandler);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.mouseMoveHandler);
        }
开发者ID:cloudree,项目名称:DualBookScanV2,代码行数:15,代码来源:CScanViewer.cs

示例14: okButton_Click

 void okButton_Click(object sender, RoutedEventArgs e)
 {
     this.DialogResult = true;
     try
     {
         if (RB90.IsChecked.HasValue && RB90.IsChecked.Value)
             angle = RotateFlipType.Rotate90FlipNone;
         else if (RB180.IsChecked.HasValue && RB180.IsChecked.Value)
             angle = RotateFlipType.Rotate180FlipNone;
         else if (RB270.IsChecked.HasValue && RB270.IsChecked.Value)
             angle = RotateFlipType.Rotate270FlipNone;
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(ex.Data);
     }
 }
开发者ID:azhi,项目名称:BSUIR_labs,代码行数:17,代码来源:Flip.xaml.cs

示例15: ImageRecognized

        public void ImageRecognized(long metric, RotateFlipType rotate, List<RecognizedWord> words)
        {
            lock (metrics)
            {
                metrics[rotate] = metric;
            }

            lock (imagesWords)
            {
                imagesWords[rotate] = words;
            }

            if (Interlocked.Decrement(ref OperationsRemain) == 0)
            {
                isImagesParsingDone.Set();
            }
        }
开发者ID:NortheasternLLC,项目名称:wpdft,代码行数:17,代码来源:DocumentProcessor.cs


注:本文中的RotateFlipType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。