• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# RotateFlipType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: okButton_Click

 void okButton_Click(object sender, RoutedEventArgs e)
 {
     this.DialogResult = true;
     try
     {
         if (CBHoriz.IsChecked.HasValue && CBHoriz.IsChecked.Value &&
             CBVert.IsChecked.HasValue && CBVert.IsChecked.Value)
             mirror = RotateFlipType.RotateNoneFlipXY;
         else if (CBHoriz.IsChecked.HasValue && CBHoriz.IsChecked.Value)
             mirror = RotateFlipType.RotateNoneFlipX;
         else if (CBVert.IsChecked.HasValue && CBVert.IsChecked.Value)
             mirror = RotateFlipType.RotateNoneFlipY;
     }
     catch (Exception ex)
     {
         Console.Error.WriteLine(ex.Data);
     }
 }
开发者ID:azhi,项目名称:BSUIR_labs,代码行数:18,代码来源:Mirror.xaml.cs


示例17: RotateAnimation

        /// <summary>
        /// Rotates a given animation
        /// </summary>
        /// <param name="image">Target image</param>
        /// <param name="rotation">Desired rotation</param>
        /// <param name="counterRotation">The complement of the desired rotation</param>
        /// <returns>Transformed image</returns>
        public virtual Bitmap RotateAnimation(Bitmap image, RotateFlipType rotation, RotateFlipType counterRotation)
        {
            // The idea lies in rotating the returnBitmap and "drawing" the "image" on the rotated
            // returnBitmap Then returnBitmap is rotated to the complementing ( 360 - rotation )
            // direction so the image seems normal

            Bitmap returnBitmap = new Bitmap(animationWidth, animationHeight);
            //make a graphics object from the empty bitmap
            using (Graphics gx = Graphics.FromImage(returnBitmap))
            {
                returnBitmap.RotateFlip(rotation);      // ex:Rotate 90

                //draw passed in image onto graphics object
                gx.InterpolationMode = InterpolationMode.HighQualityBicubic;
                gx.DrawImage(image, 0, 0, animationWidth, animationHeight);
                returnBitmap.RotateFlip(counterRotation);    // ex:Rotate 270 back
            }

            return returnBitmap;
        }
开发者ID:amrufathy,项目名称:EscapeRunner,代码行数:27,代码来源:Animation.cs


示例18: RotationTransform

 public RotationTransform(RotateFlipType rotateFlipType)
 {
     switch (rotateFlipType)
     {
         case RotateFlipType.Rotate90FlipNone:
             Angle = 90.0;
             break;
         case RotateFlipType.Rotate180FlipNone:
             Angle = 180.0;
             break;
         case RotateFlipType.Rotate270FlipNone:
             Angle = 270.0;
             break;
         case RotateFlipType.RotateNoneFlipNone:
             Angle = 0.0;
             break;
         default:
             throw new ArgumentException();
     }
 }
开发者ID:lapuinka,项目名称:naps2,代码行数:20,代码来源:RotationTransform.cs


示例19: CreateImage

	public static void CreateImage (RotateFlipType rotate, int movex, int movey, string text, Bitmap dest, Graphics grdest)
	{
		Color clr;
		Bitmap	bmp = new Bitmap (80, 80, PixelFormat.Format32bppArgb);	
		Graphics gr = Graphics.FromImage (bmp);
		gr.Clear (Color.White);
		
		gr.DrawLine (p, 10.0F, 10.0F, 70.0F, 70.0F);
		gr.DrawLine (p, 10.0F, 15.0F, 70.0F, 15.0F);
		gr.DrawRectangle (p, 10.0F, 10.0F, 60.0F, 60.0F);				
		bmp.RotateFlip (rotate);		
		
		for (int y = 0; y < 80; y++) {
			for (int x = 0; x < 80; x++) {				
				clr = bmp.GetPixel (x,y);
				dest.SetPixel (x+movex, y+movey, clr);
			}
		}							
		
		grdest.DrawString (text, new Font ("Arial", 8), br,  movex+5, movey+85);		
	}
开发者ID:nlhepler,项目名称:mono,代码行数:21,代码来源:ImageRotateFlip.cs


示例20: RotateFlip

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Rotation类代码示例发布时间:2022-05-24
下一篇:
C# Rot4类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap