当前位置:首页 » 背景图片 » vs设置背景图片
扩展阅读
加油员卡通图片 2025-08-27 02:06:23
女人用的避孕套用图片 2025-08-27 02:05:39
迷路的图片唯美 2025-08-27 01:53:59

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聊。