惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
H
Hacker News: Front Page
T
The Blog of Author Tim Ferriss
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Blog — PlanetScale
Blog — PlanetScale
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
H
Help Net Security
罗磊的独立博客
D
DataBreaches.Net
MyScale Blog
MyScale Blog
美团技术团队
人人都是产品经理
人人都是产品经理
L
LangChain Blog
M
MIT News - Artificial intelligence
C
Check Point Blog
GbyAI
GbyAI
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Y
Y Combinator Blog
雷峰网
雷峰网
Last Week in AI
Last Week in AI
F
Full Disclosure
量子位
V
Visual Studio Blog
Google DeepMind News
Google DeepMind News
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
SegmentFault 最新的问题
云风的 BLOG
云风的 BLOG
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
爱范儿
爱范儿
A
About on SuperTechFans
MongoDB | Blog
MongoDB | Blog
腾讯CDC
博客园 - 【当耐特】
U
Unit 42
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
B
Blog
T
The Exploit Database - CXSecurity.com
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
C
CERT Recently Published Vulnerability Notes
The GitHub Blog
The GitHub Blog
T
Threatpost

博客园 - 书生无用

Replace the with CR in Microsoft Excel using maven and eclipse created a mutiple module project for eclipse 开源的codecoverage(测试代码覆盖率)检测工具 使用zoudry编辑blog的设置 wiki为什么会流行 实现 DWR Sample 的几个要注意的问题(2) DWR Sample的两个问题 几个有意思的在线服务网站 静悄悄的变化 APPFUSE wiki中文文档问题解决了 appfuse使用Taperstry框架(一)——创建Tapestry框架页面 又是一个艳阳天 有几个Gmail、Wallop邀请 Appfuse开发实践(五)—— 增加校验和列表页面 Appfuse开发实践(四)——创建Webwork 框架的 Actions和JSP Appfuse开发实践(三) —— 创建Manager类 Appfuse开发实践(二)——创建DAO对象 Appfuse里面带的Ant任务列表 Appfuse实践(一)——配置安装
Improve the speed to display a transparent background winform
书生无用 · 2006-09-21 · via 博客园 - 书生无用

If you set a background picture for a Winform and add some transparent control on the form. All controls on the form will displayed one by one. The winform displays in very slow speed. I browsed some article and found the solution. Add the following code to override the BackgroundImage property of the winform.

    private Bitmap m_BackgroundBitmap;
    private const int SCREEN_WIDTH = 1024;
    private const int SCREEN_HEIGHT = 768;
    public override Image BackgroundImage
    {
      set
      {
        m_BackgroundBitmap = new Bitmap(SCREEN_WIDTH,SCREEN_HEIGHT,PixelFormat.Format32bppPArgb);
        Graphics g = Graphics.FromImage(m_BackgroundBitmap);
        g.DrawImage(value, 0, 0, m_BackgroundBitmap.Width, m_BackgroundBitmap.Height);
        g.Dispose();
      }

      get
      {
        return m_BackgroundBitmap;
      }
    }

Compile and test the application. Everything is OK. There are an useful article from MSDN which talks about the performance of the Windows Form application. The Figure 5 give the sample code to resolve the problem for the transparent background winform.

Technorati : C#