本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}