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

半透明PNG作為啟動畫面

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

問題描述

我正在嘗試使 Splash Screen 4 成為 Win 應用程序.

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

我的設置:

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

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.

在我設置的代碼中:

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;

但是當我測試時,它說表單不能有透明的背景顏色.

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

我不想設置透明鍵,因為它會導致 dropschadow 出現問題(png 的半透明部分)

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

我也不想將不透明度設置為 0%,因為它也會影響我的 PNG.

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

事實上,我只希望我的 png 顯示為窗口.另外,它上面還會有一些動態文本,將來還會有一個進程欄......

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

推薦答案

我也花了幾個小時在 Win Forms 中尋找一種方法,所以我想我會分享我的解決方案.

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.

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

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.

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

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;
    }

我只是碰到這個舊線程,因為它是我嘗試的幾個不同關鍵字組合的最高 Google 結果.

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

另請參閱 透明啟動畫面,這是我找到此解決方案的地方來自另一個 SO 帖子.

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

這篇關于半透明PNG作為啟動畫面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執行 Excel NORMINV 函數的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創建時間表的摘要描述)
C# Normal Random Number(C# 普通隨機數)
Standard deviation of generic list?(通用列表的標準偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創建一個 IAwaitable 的類)
主站蜘蛛池模板: 国产精品永久 | 成人精品一区二区三区中文字幕 | 九九久久精品 | 一级毛片大全免费播放 | 玖玖精品视频 | 国产亚洲一区二区三区在线观看 | 精品一区二区免费视频 | 伊人久久伊人 | 亚洲精品日韩一区二区电影 | 国产精品久久9 | 日韩一区二区在线播放 | 久久久久中文字幕 | 国产精品视频免费看 | 精品欧美一区二区三区久久久 | www.中文字幕.com | 91精品国产综合久久久密闭 | 久久国产精品网 | 日韩在线一区视频 | 一区二区在线不卡 | 亚洲a视频 | 精品91| 久久精品国产一区 | 日本国产欧美 | 精久久 | 婷婷丁香在线视频 | 欧美日韩亚洲系列 | 久久99精品久久久久久 | 人和拘一级毛片c | 久久久一区二区 | 羞羞的视频免费在线观看 | 国产成人精品999在线观看 | 国产激情一区二区三区 | 久久久国产精品 | 黄免费在线 | 国产精品久久亚洲 | 激情影院久久 | 成人免费在线视频 | 久久激情视频 | 国产精品欧美一区二区 | 在线观看视频你懂得 | 国户精品久久久久久久久久久不卡 |