久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

半透明PNG作為啟動(dòng)畫面

Semi Transparent PNG as Splash Screen(半透明PNG作為啟動(dòng)畫面)
本文介紹了半透明PNG作為啟動(dòng)畫面的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我正在嘗試使 Splash Screen 4 成為 Win 應(yīng)用程序.

I'm trying to make a Splash Screen 4 an Win application.

我的設(shè)置:

表單邊框樣式設(shè)置為無.起始位置是屏幕中心.表單的背景圖片設(shè)置為 PNG 文件,帶有圓角邊緣和內(nèi)置"投影.

form border style is set to none. start position is screen center. background image of the form is set to a PNG file, with rounded edges and a "build in" drop shadow.

在我設(shè)置的代碼中:

this.SetStyle( ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle( ControlStyles.UserPaint, true);
this.SetStyle( ControlStyles.DoubleBuffer, true);
this.SetStyle( ControlStyles.SupportsTransparentBackColor, true);

this.AllowTransparency = true;
this.BackColor = Color.Transparent;

但是當(dāng)我測(cè)試時(shí),它說表單不能有透明的背景顏色.

but when i test, it says that the form can't have a transparent background color.

我不想設(shè)置透明鍵,因?yàn)樗鼤?huì)導(dǎo)致 dropschadow 出現(xiàn)問題(png 的半透明部分)

i DO NOT want to set a transparency key, cuz it causes trouble with the dropschadow ( semi transparent part of the png )

我也不想將不透明度設(shè)置為 0%,因?yàn)樗矔?huì)影響我的 PNG.

also i dont want to set opacity to 0%, cuz it also effects my PNG.

事實(shí)上,我只希望我的 png 顯示為窗口.另外,它上面還會(huì)有一些動(dòng)態(tài)文本,將來還會(huì)有一個(gè)進(jìn)程欄......

in fact i just want ONLY my png shown as the window. additionaly there will be some dynamic text on top of it and a process bar in the future...

有什么想法嗎?如何判斷表單可以有透明背景就像ADOBE PHOTOSHOP CS5的閃屏

Any ideas? how to tell the form that is CAN have transparent background like the splash screen of ADOBE PHOTOSHOP CS5

推薦答案

我也花了幾個(gè)小時(shí)在 Win Forms 中尋找一種方法,所以我想我會(huì)分享我的解決方案.

I spent a few hours looking for a way to do this in Win Forms as well so I thought I would share my solution.

我的初始屏幕圖像是一個(gè) .png,具有透明背景和在透明背景上延伸的各種陰影.使用不常見的顏色作為控件的背景以及透明度鍵會(huì)在半透明陰影下方留下難看的補(bǔ)丁.

My splash screen image is a .png with a transparent background and various shadows that extend over the transparent background. Using uncommon colors as the background of the control along with a transparency key left ugly patches underneath the semi-transparent shadows.

通過將表單的背景圖像設(shè)置為我想要顯示的圖像并覆蓋 OnPaintBackground 函數(shù),我能夠獲得所需的結(jié)果,如下所示:

I was able to get the desired result by setting the background image of the form to the image I wanted to display and overriding the OnPaintBackground function like so:

    bool painted = false
    protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e)
    {
        if (painted) return;
        e.Graphics.DrawImage(BackgroundImage, new System.Drawing.Point(0, 0));
        painted = true;
    }

我只是碰到這個(gè)舊線程,因?yàn)樗俏覈L試的幾個(gè)不同關(guān)鍵字組合的最高 Google 結(jié)果.

I'm only bumping this old thread because it's the top Google result for a few different keyword combos that I tried.

另請(qǐng)參閱 透明啟動(dòng)畫面,這是我找到此解決方案的地方來自另一個(gè) SO 帖子.

See also Transparent Splash Screen which is where I found this solution from another SO post.

這篇關(guān)于半透明PNG作為啟動(dòng)畫面的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執(zhí)行 Excel NORMINV 函數(shù)的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權(quán)列表中選擇 x 個(gè)隨機(jī)元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創(chuàng)建時(shí)間表的摘要描述)
C# Normal Random Number(C# 普通隨機(jī)數(shù))
Standard deviation of generic list?(通用列表的標(biāo)準(zhǔn)偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創(chuàng)建一個(gè) IAwaitable 的類)
主站蜘蛛池模板: 97精品超碰一区二区三区 | 免费网站av| 久久国内精品 | 午夜视频免费 | 欧美在线观看视频 | 黄色av大片| 超碰99在线 | 九月色婷婷| 黄色片一区二区 | 国产美女网站 | 亚洲免费播放 | 在线91| 九九热在线观看视频 | 国产视频黄色 | 亚洲 欧美 激情 另类 校园 | 欧美在线不卡 | 日日夜夜天天操 | 免费观看一区二区 | 天天cao| 91av在线免费观看 | 欧美不卡一区二区三区 | 久久久夜色精品亚洲 | 免费黄色片网站 | 中文字幕在线免费观看视频 | 国产色自拍 | 一区二区三区高清 | 色羞羞| 四虎影视大全 | 亚洲在线视频观看 | 天堂视频在线免费观看 | 国产理论片 | 成人免费看片98欧美 | 久草综合网 | 日韩hd| 日韩有码在线视频 | 久久久久久一区 | 欧美午夜精品 | 羞羞的视频在线观看 | 成年人小视频 | av老司机在线 | 日韩国产在线播放 |