[英]How can I add a background image in react native so that it takes the whole height of the screen but only part of the width?
[英]How can I change the width of the image in the welcome and finish pages in NSIS so that it will look like a background?
我想創建一個安裝程序,其中在歡迎頁面和完成頁面中而不是左側的橫幅中,有一個背景圖像覆蓋了對話框的整個寬度。
歡迎和完成頁面是使用nsDialogs創建的自定義 NSIS 頁面。 但是,如果您希望 bitmap 覆蓋整個對話框,那么您還需要對實際的 UI 文件進行一些修改。
復制...\NSIS\Contrib\UIs\modern.exe 到 myui.exe
使用Resource Hacker將 bitmap 控件添加到對話框 105。
在 your.nsh 的頂部,將 MUI_UI 定義為 myui.exe 的路徑
使用 nsDialogs 創建自定義頁面以模仿歡迎和完成頁面。 在調用nsDialogs::Show
之前你需要:
SetCtlColors
以使其透明。LoadAndSetImage
將圖像加載到您在對話框 105 中創建的控件中。如果您不想自己完成所有這些,您可以使用Graphical Installer第 3 方產品。
以下是使用頁面區域的示例:
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyHijackWelcome
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
Page Custom MyFullBitmapPage
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_LANGUAGE English
!include nsDialogs.nsh
PEAddResource "${NSISDIR}\Contrib\Graphics\Header\orange-nsis.bmp" "#Bitmap" "#1337" ; Lazy way to include an image
Function MyFullBitmapPage
ShowWindow $mui.Branding.Background ${SW_HIDE}
ShowWindow $mui.Branding.Text ${SW_HIDE}
nsDialogs::Create 1044
Pop $1
${NSD_CreateLabel} 10u 25u 100% 12u "Hello world"
Pop $2
SetCtlColors $2 000000 transparent
${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $2
LoadAndSetImage /EXERESOURCE /RESIZETOFIT $2 0 0 1337 $3
nsDialogs::Show
${NSD_FreeBitmap} $3
ShowWindow $mui.Branding.Background ${SW_SHOW}
ShowWindow $mui.Branding.Text ${SW_SHOW}
FunctionEnd
Function MyHijackWelcome
SendMessage $mui.WelcomePage.Image ${STM_SETIMAGE} 0 0
${NSD_FreeBitmap} $mui.WelcomePage.Image.Bitmap
${NSD_CreateBitmap} 0 0 100% 100% ""
Pop $mui.WelcomePage.Image
LoadAndSetImage /EXERESOURCE /RESIZETOFIT $mui.WelcomePage.Image 0 0 1337 $mui.WelcomePage.Image.Bitmap
SetCtlColors $mui.WelcomePage.Title 000000 transparent
SetCtlColors $mui.WelcomePage.Text 000000 transparent
FunctionEnd
如果您希望 bitmap 擴展到頁面區域的邊界之外,您必須使用我最初的建議!define MUI_UI
+ GetDlgItem
+ LoadAndSetImage
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.