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

推荐订阅源

B
Blog
T
Threatpost
N
News and Events Feed by Topic
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
C
CXSECURITY Database RSS Feed - CXSecurity.com
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
AI
AI
GbyAI
GbyAI
Recent Announcements
Recent Announcements
Security Latest
Security Latest
Scott Helme
Scott Helme
W
WeLiveSecurity
S
Schneier on Security
人人都是产品经理
人人都是产品经理
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园_首页
Forbes - Security
Forbes - Security
Simon Willison's Weblog
Simon Willison's Weblog
S
Security @ Cisco Blogs
The Register - Security
The Register - Security
H
Hacker News: Front Page
V
Visual Studio Blog
P
Privacy & Cybersecurity Law Blog
P
Privacy International News Feed
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
News | PayPal Newsroom
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google DeepMind News
Google DeepMind News
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
CERT Recently Published Vulnerability Notes
Y
Y Combinator Blog
D
Docker
I
InfoQ
AWS News Blog
AWS News Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Securelist
L
LINUX DO - 最新话题
阮一峰的网络日志
阮一峰的网络日志
Help Net Security
Help Net Security
G
GRAHAM CLULEY
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
I
Intezer

博客园 - 书生无用

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#