當前位置:首頁 » 背景圖片 » vs設置背景圖片
擴展閱讀

vs設置背景圖片

發布時間: 2022-07-13 05:12:59

A. vs2005里怎樣載入背景,最好是一些圖片(c#)

C#添加背景圖片的方法:
VS2005的IDE中的WinForm界面的屬性有一個Image設置項,選擇後會出現選擇圖片的對話框,選擇了所要的圖片後按確認鍵後,WinForm界面的背景就變為該圖片了。

B. vs2008中怎樣添加圖片作為頁面背景

點擊頁面的屬性,在屬性里有一個屬性background是可以改變背景的

C. VS上如何給層就如背景圖片

那你就用把你的那個FLSH的那個參數設置使插入的Flash處於選擇狀態,點擊屬性面板中的「參數」,在隨即彈出的參數表中添加一行,參數名為「wmode」,值為「transparent .然後你插入圖片做背景

D. 在VS2010網站設計中如何添加背景圖片

是網頁嗎?那就要用到css樣式了。你可以在頁面的<head>標記中,寫上這么一句:
<style>background:url('這里寫上背景圖片的地址');</style>

E. 怎麼改變VS2012背景

在開始之前,先准備Visual Studio 2012 SDK
安裝好SDK後,進入VS。先新建一個Project,在「其它項目類型」那裡找到「Visual Studio Package」

接下來的對話框里,選「C#」,然後基本是下一步。在最後一步把那兩個復選框取消,因為那個在這里沒什麼用處。最後就成功新建了個VS擴展的Project

三、初步改造
第一步我們給VS加上背景圖。首先對Project添加WPF的程序集為引用,有四個,分別為「PresentationCore」、「PresentationFramework」、「System.Xaml」、「WindowsBase」。然後打開「XXXPackage.cs」(XXX一般為這個Project的名字)文件,代碼如下:

usingMicrosoft.VisualStudio.Shell;
usingMicrosoft.VisualStudio.Shell.Interop;
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Moen.IDEBackground //命名空間自己修改回自己用的
{
[PackageRegistration(UseManagedResourcesOnly = true)]
[InstalledProctRegistration("#110", "#112","1.0", IconResourceID = 400)]
[Guid(GuidList.guidIDE_BackgroundPkgString)]
[ProvideAutoLoad(UIContextGuids.NoSolution)]
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
public sealed class IDEBackgroundPackage :Package
{
protected override void Initialize()
{
base.Initialize();

Application.Current.MainWindow.Loaded += MainWindow_Loaded;
}

void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
var rWindow = (Window)sender;

//載入圖片
var rImageSource =BitmapFrame.Create(new Uri(@"G:\Picture\Pool\絵師100人展02_p109.png"/*圖片路徑*/),BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
rImageSource.Freeze();

var rImageControl = new Image()
{
Source = rImageSource,
Stretch =Stretch.UniformToFill, //按比例填充
HorizontalAlignment =HorizontalAlignment.Center, //水平方向中心對齊
VerticalAlignment =VerticalAlignment.Center, //垂直方向中心對齊
};

Grid.SetRowSpan(rImageControl, 4);
var rRootGrid =(Grid)rWindow.Template.FindName("RootGrid", rWindow);
rRootGrid.Children.Insert(0, rImageControl);
}
}
}

代碼修改一下後,調試,這時就會編譯擴展,然後啟動實驗用VS。(如果這是第一次啟動實驗用VS,可能要像剛安裝完VS那樣設置一下)接著你會看到角落處顯現出那張背景圖
(免調試進入實驗用VS方法:開始菜單->Microsoft Visual Studio 2012->Microsoft Visual Studio SDK->Tools->Start Experimental Instance of Visual Studio 2012)

四、修改皮膚配色
為了方便,在實驗用VS處進入「工具->擴展功能和更新程序」,選「在線」部分,然後在中間找到「Visual Studio 2012 Color ThemeEditor」並安裝,重啟實驗用VS
重啟後,進入「工具->CustomizeColors」。本例子已深色為基礎,於是在左邊「New Theme」處,直接在文本框輸入一個皮膚名,然後點「Create」。這樣就進入了皮膚配色表

首先把主界面那一大塊灰色給除掉。找到「Environment→ EnvironmentBackgroundGradient」為開頭的,統統都把不透明度設為0。然後點表左上角的「Save andApply Theme」,關掉所有頁面。然後你就會看到背景啦

再繼續,找到「Environment→ MainWindowActiveCaption」、「Environment→ MainWindowInactiveCaption」、「Environment→ 」、「Environment→ 」、「Environment→ CommandBarGradientXXX」、「Environment→ CommandBarToolBarBorder」,都把不透明度設為0,
然後應用。上面那部分灰色的也沒啦
至於這些是對應哪裡的呢,可以通過那名字來確定,不過不準。要詳細弄清楚很麻煩,要用反編譯軟體反要修改的控制項的xaml文檔,找到對應的畫刷名。非常復雜,所以我這里提供我自己用的。在「Customize Colors」那裡點「Import Theme」即可

五、編輯器
到目前為止,打開文件後,編輯器的背景還是黑的。接下來就是把這層黑的去掉
先打開「source.extension.vsixmanifest」文件,進入「Assets」選項卡,單擊「New」按鈕。在彈出的對話框里,「Type」選「Microsoft.VisualStudio.MefComponent」,「Source」選「Aproject in current solution」,「Project」選當前的Project,目前應該就一個選項的。最後OK
接下來新建一個文件,這里就叫「EditorBackground.cs」
在輸入代碼前添加幾個引用——System.ComponentModel.Composition、Microsoft.VisualStudio.CoreUtility、Microsoft.VisualStudio.Text.UI、Microsoft.VisualStudio.Text.UI.Wpf(後三個在「擴展」處找)
搞定後文件代碼如下:
usingMicrosoft.VisualStudio.Text.Classification;
usingMicrosoft.VisualStudio.Text.Editor;
usingMicrosoft.VisualStudio.Utilities;
usingSystem;
usingSystem.ComponentModel.Composition;
usingSystem.Windows;
usingSystem.Windows.Controls;
usingSystem.Windows.Media;
using System.Windows.Threading;

namespaceMoen.IDEBackground
{
[Export(typeof(IWpfTextViewCreationListener))]
[ContentType("Text")]
[ContentType("BuildOutput")]
[TextViewRole(PredefinedTextViewRoles.Document)]
class Listener : IWpfTextViewCreationListener
{
[Import]
= null;

public voidTextViewCreated(IWpfTextView rpTextView)
{
new EditorBackground(rpTextView);

//去掉斷點邊欄的背景
var rProperties =EditorFormatMapService.GetEditorFormatMap(rpTextView).GetProperties("IndicatorMargin");
rProperties["BackgroundColor"] = Colors.Transparent;
rProperties["Background"]= Brushes.Transparent;
}
}

class EditorBackground
{
IWpfTextView r_TextView;
ContentControl r_Control;
Grid r_ParentGrid;
Canvas r_ViewStack;

public EditorBackground(IWpfTextViewrpTextView)
{
r_TextView = rpTextView;
r_Control = (ContentControl)r_TextView;
r_TextView.Background =Brushes.Transparent;
r_TextView.BackgroundBrushChanged+= TextView_BackgroundBrushChanged;
r_TextView.Closed +=TextView_Closed;
r_Control.Loaded +=TextView_Loaded;
}
void MakeBackgroundTransparent()
{
r_TextView.Background =Brushes.Transparent;
r_ViewStack.Background =Brushes.Transparent;
r_ParentGrid.ClearValue(Grid.BackgroundProperty);
}
void TextView_Loaded(object sender,RoutedEventArgs e)
{
if (r_ParentGrid == null)
r_ParentGrid =(Grid)r_Control.Parent;
if (r_ViewStack == null)
r_ViewStack =(Canvas)r_Control.Content;
MakeBackgroundTransparent();
}
voidTextView_BackgroundBrushChanged(object sender, )
{
r_Control.Dispatcher.BeginInvoke(new Action(() =>
{
while (r_ParentGrid.Background!= null)
MakeBackgroundTransparent();
}), DispatcherPriority.Render);
}
void TextView_Closed(object sender,EventArgs e)
{
//清除委託,以防內存泄露
r_TextView.Closed -=TextView_Closed;
r_TextView.BackgroundBrushChanged-= TextView_BackgroundBrushChanged;
}
}
}
調試進入實驗用VS,進入配色表,找到「Environment →EnvironmentBackground」,設置一個顏色值(我這里是#A0000000),作為編輯器的背景色。再找到「Environment → Window」設置為透明

六、結尾
基本的VS界面改造就是這么多了。不過有個棘手的問題——xaml編輯器和個別的編輯器(如HTML的)因為是承載在VS的一個子窗口上,而這個窗口的背景是黑色的。目前仍在研究中……

F. vs2013中怎麼設置網頁的背景圖片

直接寫標記最簡單:<IMG SRC="1.jpg" WIDTH="100" HEIGHT="100" BORDER="0" ALT="圖片">
也可以工具欄中找到image控制拖放入頁面,再指定圖片路徑,當然也可以加入伺服器控制項中的image控制項,如果僅僅是在頁面顯示一張圖片,最好使用HTML控制項,這樣不會回傳伺服器,不佔用伺服器資源。

G. vs中如何讓一張背景圖片的大小隨著屏幕的大小而改變,,,,在線等。。。。。。。。。。。

摘要 直接插入圖片 高度和寬度設置100%就好了

H. vs2022怎麼換背景

點擊菜單欄--「擴展」按鈕,選擇管理擴展
搜索框輸入「background」,選擇第一個安裝包--「ClaudiaIDE」
下載並重新啟動
重啟後會看到默認的背景,我們也可以自定義背景圖。點擊菜單欄--「工具」按鈕,點擊「選項」,找到「ClaudiaIDE」,然後更改圖片路徑即可。 有需要的也可以在「布局」裡面更改圖片屬性,使背景看起來更舒服

I. VS怎麼永久性地改變窗體背景圖片啊 C#

這個問題很簡單啊。你現在可以通過按鈕事件來更換背景圖片,那麼你可以這樣做:在窗體初始化的事件中更改背景圖片(邏輯代碼都一樣,只不過是觸發時機不同而已)。這樣就每次運行的時候就會在窗體生成之後自動更換背景圖片了。不明白再問。

J. VS2005中怎麼添加背景圖片,在<td> </td>中添加,路徑怎麼寫

首先:要確保td中要有內容或者有設置了高度和寬度。<td style="background:url('圖片地址')"></td>這樣就可以設置它的背景圖片了。希望幫到你,如果有疑問請加:1534968714,qq聊。