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

C# Transformation类代码示例

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

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



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

示例1: BrightnessBarChanged

 private void BrightnessBarChanged()
 {
     Transformation transform = new Transformation();
     transform.type = TransformationType.BRIGHTNESS_CHANGE;
     transform.argument = getNormalizedBrightnessLevel();
     TransformImage(transform);
 }
开发者ID:jgreenlee24,项目名称:PhotoEditor,代码行数:7,代码来源:EditForm.cs


示例2: CalculateImageAndTransformationMatrix

        private void CalculateImageAndTransformationMatrix(string fileName)
        {
            var zipFile = new Ionic.Zip.ZipFile(fileName);
              var mapSize = new Size();
              Transformation = new Transformation();

              // get entry for kml file and image file
              KmlDocument kmlDocument = null;
              foreach (var entry in zipFile)
              {
            if (entry.FileName == entry.LocalFileName && Path.GetExtension(entry.FileName) == ".kml")
            {
              using (var kmlStream = new MemoryStream())
              {
            entry.Extract(kmlStream);
            kmlStream.Position = 0;
            kmlDocument = new KmlDocument(kmlStream);
              }
              break;
            }
              }

              if (kmlDocument != null)
              {
            // we have got a kml document, get map image file stream from it
            foreach (var entry in zipFile)
            {
              if (entry.FileName == kmlDocument.ImageFileName)
              {
            ImageStream = new MemoryStream();
            entry.Extract(ImageStream);
            ImageStream.Position = 0;
            // check if image is QR jpeg
            var ed = QuickRouteJpegExtensionData.FromStream(ImageStream);
            if(ed != null)
            {
              // get transformation matrix from QR jpeg metadata
              Transformation = ed.Sessions.CalculateAverageTransformation();
              ImageStream.Position = 0;
              return;
            }
            else
            {
              // it is not, use normal image bounds
              ImageStream.Position = 0;
              mapSize = Image.FromStream(ImageStream).Size; // need to get image object to get image size
            }
            ImageStream.Position = 0;
            break;
              }
            }
              }

              if (kmlDocument != null && ImageStream != null)
              {
            // finally, calculate the transformation
            Transformation = new Transformation(kmlDocument.LongLatBox, mapSize);
              }
        }
开发者ID:jarkko,项目名称:quickroute-gps,代码行数:59,代码来源:KmzDocument.cs


示例3: CloudinaryImage_WithAutoAngle_AddsPosition

        public void CloudinaryImage_WithAutoAngle_AddsPosition()
        {
            var transformation = new Transformation(240, 240) {Angle = Angle.Auto};

            string url = Url.CloudinaryImage("angled", transformation).ToString();

            Assert.AreEqual("http://res.cloudinary.com/test/image/upload/w_240,h_240,a_auto/angled.jpg", url);
        }
开发者ID:thomasvm,项目名称:cloudinary-dotnet,代码行数:8,代码来源:CloudinaryUrlHelpersTests.cs


示例4: MeshNode

        public MeshNode(string label, NsNode parent, double[,] initTransform)
            : this(label, parent)
        {
            for (int i = 0; i < 3; i++)
                    initTransform[i, 3] *= 1000;

               m_T = new Transformation(initTransform);
        }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:8,代码来源:MeshNode.cs


示例5: CloudinaryImage_WithEffect_AddsEffect

        public void CloudinaryImage_WithEffect_AddsEffect()
        {
            var transformation = new Transformation(30, 90);
            transformation.Effect = "sepia";

            string url = Url.CloudinaryImage("effected", transformation).ToString();
            Assert.AreEqual("http://res.cloudinary.com/test/image/upload/w_30,h_90,e_sepia/effected.jpg", url);
        }
开发者ID:thomasvm,项目名称:cloudinary-dotnet,代码行数:8,代码来源:CloudinaryUrlHelpersTests.cs


示例6: CloudinaryImage_WithFixedCroppingPositionSet_AddPosition

        public void CloudinaryImage_WithFixedCroppingPositionSet_AddPosition()
        {
            var transformation = new Transformation(240, 240) { Crop = CropMode.Crop };
            transformation.SetFixedCroppingPosition(350, 510);

            string url = Url.CloudinaryImage("cropme", transformation).ToString();

            Assert.AreEqual("http://res.cloudinary.com/test/image/upload/w_240,h_240,x_350,y_510,c_crop/cropme.jpg", url);
        }
开发者ID:sparra,项目名称:cloudinary-dotnet,代码行数:9,代码来源:CloudinaryUrlHelpersTests.cs


示例7: TestBaseTransformationChain

        public void TestBaseTransformationChain()
        {
            // should support base transformation

            Transformation transformation = new Transformation().X(100).Y(100).Crop("fill").Chain().Crop("crop").Width(100);
            string uri = api.UrlImgUp.Transform(transformation).BuildUrl("test");
            Assert.AreEqual("100", transformation.HtmlWidth);
            Assert.AreEqual("http://res.cloudinary.com/testcloud/image/upload/c_fill,x_100,y_100/c_crop,w_100/test", uri);
        }
开发者ID:iitr-ankur,项目名称:CloudinaryMono,代码行数:9,代码来源:ApiTest.cs


示例8: TestBackground

 public void TestBackground()
 {
     // should support background
     Transformation transformation = new Transformation().Background("red");
     String result = m_api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual(m_defaultImgUpPath + "b_red/test", result);
     transformation = new Transformation().Background("#112233");
     result = m_api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual(m_defaultImgUpPath + "b_rgb:112233/test", result);
 }
开发者ID:cloudinary,项目名称:CloudinaryDotNet,代码行数:10,代码来源:ApiTest.cs


示例9: TestBackground

 public void TestBackground()
 {
     // should support background
     Transformation transformation = new Transformation().Background("red");
     String result = api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual("http://res.cloudinary.com/testcloud/image/upload/b_red/test", result);
     transformation = new Transformation().Background("#112233");
     result = api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual("http://res.cloudinary.com/testcloud/image/upload/b_rgb:112233/test", result);
 }
开发者ID:iitr-ankur,项目名称:CloudinaryMono,代码行数:10,代码来源:ApiTest.cs


示例10: EndIf

 public void EndIf()
 {
     Transformation transformation = new Transformation().IfCondition("w_lt_200").Crop("fill").Height(120).Width(80).Effect("sharpen")
         .Chain().Effect("brightness", 50)
         .Chain().Effect("shadow").Color("red")
         .EndIf();
     string sTransform = transformation.ToString();
     Assert.IsTrue(sTransform.EndsWith("if_end"), "should include the if_end as the last parameter in its component");
     Assert.AreEqual("if_w_lt_200/c_fill,e_sharpen,h_120,w_80/e_brightness:50/co_red,e_shadow/if_end", sTransform, "should be proper transformation string");
 }
开发者ID:cloudinary,项目名称:CloudinaryDotNet,代码行数:10,代码来源:TransformationApiTest.cs


示例11: TestAngle

 public void TestAngle()
 {
     // should support angle
     Transformation transformation = new Transformation().Angle(12);
     String result = m_api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual(m_defaultImgUpPath + "a_12/test", result);
     transformation = new Transformation().Angle("exif", "12");
     result = m_api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual(m_defaultImgUpPath + "a_exif.12/test", result);
 }
开发者ID:cloudinary,项目名称:CloudinaryDotNet,代码行数:10,代码来源:ApiTest.cs


示例12: CanInsertCollectionOfItemsToScene

        public void CanInsertCollectionOfItemsToScene()
        {
            var map = new Map();
            var transformation = new Transformation(500, 500);
            var transformation2 = new Transformation(100, 100);

            map.Insert("grass", new List<Transformation> { transformation, transformation2 });

            Assert.AreEqual(map.Scene["grass"].Count, 2);
        }
开发者ID:zumpiez,项目名称:Chopsticks,代码行数:10,代码来源:MapTests.cs


示例13: CanInsertItemToScene

        public void CanInsertItemToScene()
        {
            var map = new Map();

            var transformation = new Transformation(500, 500);

            map.Insert("grass", transformation);

            Assert.AreEqual(map.Scene["grass"].First().Translation, transformation.Translation);
        }
开发者ID:zumpiez,项目名称:Chopsticks,代码行数:10,代码来源:MapTests.cs


示例14: TestAngle

 public void TestAngle()
 {
     // should support angle
     Transformation transformation = new Transformation().Angle(12);
     String result = api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual("http://res.cloudinary.com/testcloud/image/upload/a_12/test", result);
     transformation = new Transformation().Angle("exif", "12");
     result = api.UrlImgUp.Transform(transformation).BuildUrl("test");
     Assert.AreEqual("http://res.cloudinary.com/testcloud/image/upload/a_exif.12/test", result);
 }
开发者ID:iitr-ankur,项目名称:CloudinaryMono,代码行数:10,代码来源:ApiTest.cs


示例15: EndIf2

        public void EndIf2()
        {
            Transformation transformation = new Transformation().IfCondition().Width("gt", 100).And().Width("lt", 200).Then().Width(50).Crop("scale").EndIf();
            Assert.AreEqual("if_w_gt_100_and_w_lt_200/c_scale,w_50/if_end", transformation.ToString(), "should serialize to 'if_end'");

            transformation = new Transformation().IfCondition().Width("gt", 100).And().Width("lt", 200).Then().Width(50).Crop("scale").EndIf();
            Assert.AreEqual("if_w_gt_100_and_w_lt_200/c_scale,w_50/if_end", transformation.ToString(), "force the if clause to be chained");

            transformation = new Transformation().IfCondition().Width("gt", 100).And().Width("lt", 200).Then().Width(50).Crop("scale").IfElse().Width(100).Crop("crop").EndIf();
            Assert.AreEqual("if_w_gt_100_and_w_lt_200/c_scale,w_50/if_else/c_crop,w_100/if_end", transformation.ToString(), "force the if_else clause to be chained");
        }
开发者ID:cloudinary,项目名称:CloudinaryDotNet,代码行数:11,代码来源:TransformationApiTest.cs


示例16: Trees

        public Trees(Game game, ContentManager content, GraphicsDeviceManager graphics)
            : base(game)
        {
            this.content = content;
            camera = Game.Services.GetService(typeof(ChaseCamera)) as ChaseCamera;
            terrain = Game.Services.GetService(typeof(Terrain)) as Terrain;
            this.graphics = graphics;

            transformation = new Transformation();
            transformation.Scale = new Vector3(TREE_SCALE);
        }
开发者ID:ravduke,项目名称:Tank-Wars,代码行数:11,代码来源:Trees.cs


示例17: CloudinaryImage_WithDefaultImageSpecified_AddsDefaultImageToUrl

        public void CloudinaryImage_WithDefaultImageSpecified_AddsDefaultImageToUrl()
        {
            var transformation = new Transformation(240, 240)
                                     {
                                         DefaultImage = "sample.jpg"
                                     };

            string url = Url.CloudinaryImage("face", transformation).ToString();

            Assert.AreEqual("http://res.cloudinary.com/test/image/upload/w_240,h_240,d_sample.jpg/face.jpg", url);
        }
开发者ID:thomasvm,项目名称:cloudinary-dotnet,代码行数:11,代码来源:CloudinaryUrlHelpersTests.cs


示例18: ToCloudinary_WithTwoTransformations_CombinesThem

        public void ToCloudinary_WithTwoTransformations_CombinesThem()
        {
            var first = new Transformation(20, 40) { Angle = new Angle(40)};
            var second = new TransformationBase
                             {
                                 Effect = "sepia"
                             };

            var chained = new ChainedTransformation(first, second);

            Assert.AreEqual("w_20,h_40,a_40/e_sepia", chained.ToCloudinary());
        }
开发者ID:thomasvm,项目名称:cloudinary-dotnet,代码行数:12,代码来源:ChainedTransformationTests.cs


示例19: AnimatedModel

        public AnimatedModel(Game game)
            : base(game)
        {
            // Animation
            enableAnimationLoop = true;
            animationSpeed = 1.0f;
            activeAnimationKeyframe = 0;
            activeAnimationTime = TimeSpan.Zero;

            transformation = new Transformation();

            isInitialized = false;
        }
开发者ID:Oliverreason,项目名称:sitsdev,代码行数:13,代码来源:AnimatedModel.cs


示例20: MeshTestScene

        public MeshTestScene(int width, int height)
        {
            Width = width;
            Height = height;

            rasterizer = new Rasterizer(Width, Height);
            inputStateService = new InputStateService();
            transformation = new Transformation();

            currentWavefrontObjectFilePath = "Models\\woman1.obj";

            InitScene(currentWavefrontObjectFilePath);
        }
开发者ID:ckarcz,项目名称:GraphicsEngine,代码行数:13,代码来源:MeshTestScene.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# TransformationData类代码示例发布时间:2022-05-24
下一篇:
C# TransformSmoothParameters类代码示例发布时间: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