C#纹理画刷TextureBrush用法实例
程序员文章站
2022-06-30 11:15:54
本文实例讲述了c#纹理画刷texturebrush用法。分享给大家供大家参考。具体如下:
using system;
using system.collecti...
本文实例讲述了c#纹理画刷texturebrush用法。分享给大家供大家参考。具体如下:
using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.drawing.drawing2d; using system.text; using system.windows.forms; namespace windowsapplication2 { public partial class form6 : form { public form6() { initializecomponent(); } private void form6_load(object sender, eventargs e) { } private void button1_click(object sender, eventargs e) { try { bitmap image1 = (bitmap)image.fromfile(@"e:/ico/administrator.bmp", true); texturebrush texture = new texturebrush(image1); texture.wrapmode = system.drawing.drawing2d.wrapmode.tileflipx; graphics formgraphics = this.creategraphics(); formgraphics.fillellipse(texture, new rectanglef(90.0f, 110.0f, 100, 100)); formgraphics.dispose(); } catch (system.io.filenotfoundexception) { messagebox.show("there was an error opening the bitmap." + "please check the path."); } } } }
希望本文所述对大家的c#程序设计有所帮助。
上一篇: 司马懿的两个儿子司马师和司马昭为什么没有在权力的斗争中自相残杀?
下一篇: C#透明窗体实现方法