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


C# Bitmap.Flush方法代码示例

本文整理汇总了C#中Bitmap.Flush方法的典型用法代码示例。如果您正苦于以下问题:C# Bitmap.Flush方法的具体用法?C# Bitmap.Flush怎么用?C# Bitmap.Flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitmap的用法示例。


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

示例1: BitmapStressTest_RotateImage

        public MFTestResults BitmapStressTest_RotateImage()
        {
            MFTestResults result = MFTestResults.Fail;
            
            Log.Comment("Rotate bitmaps");
            
            Bitmap bmpSrc = null;
            Bitmap bmpDst = null;
            
            try
            {
                bmpDst = new Bitmap(width, height);

                bmpSrc = new Bitmap(WaterFallJpg.WaterFall, Bitmap.BitmapImageType.Jpeg);
                bmpDst.StretchImage(0, 0, bmpSrc, bmpSrc.Width, bmpSrc.Height, 0x0100);
                bmpDst.Flush();

                System.Threading.Thread.Sleep(200);

                
                for (int i = 1; i < 4; ++i )
                {
                    bmpDst.RotateImage(90 * i , 0, 0, bmpSrc, 0, 0, bmpSrc.Width, bmpSrc.Height, 0xFFFF);
                    bmpDst.Flush();

                    System.Threading.Thread.Sleep(200);
                }

                result = MFTestResults.Pass;
            }
            catch (Exception e)
            {
                Log.Exception( "Caught exception: " + e.Message);
            }
            finally
            {
                if(bmpSrc != null)
                {
                    bmpSrc.Dispose();
                }
                if(bmpDst != null)
                {
                    bmpDst.Dispose();
                }
                Debug.GC(true);
                System.Threading.Thread.Sleep(500);
            }

            return result;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:50,代码来源:BitmapTest.cs

示例2: StretchImage

        public MFTestResults StretchImage()
        {
            Bitmap screen = new Bitmap(width, height);

            Bitmap btn = new Bitmap(WaterFallJpg.WaterFall, Bitmap.BitmapImageType.Jpeg);
            
            screen.StretchImage(10, 10, 15, 75,
                                    btn,
                                    btn.Width / 2, 0, btn.Width / 2, btn.Height / 2,
                                    256);

            screen.Flush();

            screen.StretchImage(20, 20, 30, 150,
                                    btn,
                                    btn.Width / 2, 0, btn.Width / 2, btn.Height / 2,
                                    256);
            screen.Flush();

            screen.StretchImage(40, 40, 60, 250,
                                    btn,
                                    btn.Width / 2, 0, btn.Width / 2, btn.Height / 2,
                                    256);
            screen.Flush();

            System.Threading.Thread.Sleep(500);

            screen.Dispose();
            btn.Dispose();

            return MFTestResults.Pass;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:32,代码来源:BitmapTest.cs

示例3: TileImage

        public MFTestResults TileImage()
        {
            Bitmap screen = new Bitmap(width, height);

            Bitmap btn = new Bitmap(WaterFallJpg.WaterFall, Bitmap.BitmapImageType.Jpeg);
            
            screen.DrawRectangle(Color.White, 0, 0, 0, width, height, 0, 0, Color.White, 0, 0, 0, 0, 0, 256);

            screen.TileImage( 5, 10, btn, width - 50, height / 2, 256);

            screen.Flush();

            System.Threading.Thread.Sleep(500);

            screen.Dispose();
            btn.Dispose();

            return MFTestResults.Pass;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:19,代码来源:BitmapTest.cs

示例4: Scale9ImageTest

        public MFTestResults Scale9ImageTest()
        {
            Bitmap screen = new Bitmap(width, height);

            Bitmap btn = new Bitmap(WaterFallJpg.WaterFall, Bitmap.BitmapImageType.Jpeg);

            btn.MakeTransparent(ColorUtility.ColorFromRGB(255, 0, 255));

            screen.DrawRectangle(Color.White, 0, 0, 0, width, height, 0, 0, Color.White, 0, 0, 0, 0, 0, 256);

            screen.Scale9Image(30, 30, width / 3, height / 3, btn, 6, 6, 6, 6, 256);
            screen.Scale9Image(width / 2, height / 2, width / 3, 30, btn, 6, 6, 6, 6, 256);
            screen.Scale9Image(30, height / 2, 30, height / 3, btn, 6, 6, 6, 6, 256);
            screen.Scale9Image(width / 2, 30, 30, 30, btn, 6, 6, 6, 6, 256);

            screen.Flush();

            System.Threading.Thread.Sleep(500);

            screen.Dispose();
            btn.Dispose();

            return MFTestResults.Pass;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:24,代码来源:BitmapTest.cs


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