In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to add background picture expansion to Visual Studio 2010. The article is very detailed and has certain reference value. Interested friends must finish reading it!
A few days ago, I went on a whim to the Visual Studio extension library and found such an extension: http://visualstudiogallery.msdn.microsoft.com/zh-cn/0e6f9037-b753-469e-86d4-bfba78c74cf6
However, there are still some inconveniences in using this extension, such as locking the background image file, zooming the editor when the background image floats to the top due to the positioning of the scroll bar, transparency and the position of the background image cannot be changed, and so on.
It has been five months since the extension was updated on May 5. So I decided to follow its principle and write one myself.
The effect of use is something like this:
In fact, this thing is relatively easy to do, as long as you install Visual Studio 2010 SDK to create an Editor Viewport Adornment project, it is easy to build extensions like this on the basis of the new project.
This extension is set up through a XML file, which is automatically created in the "my documents" file named "ItaBackgroundKyuu.config" when Visual Studio 2010 is launched * after installing the extension.
The parameters used are common data types in WPF and BCL:
Public AlignmentX AlignXpublic AlignmentY AlignYpublic Stretch StretchModepublic TileMode TileMode public StretchDirection ScaleDir;public Stretch ScaleMode;public HorizontalAlignment HAlign;public VerticalAlignment VAlign
On my machine (that is, the source of the effect above), it is set up as follows:
D:\ Files\ Yuki\ Pictures\ haoren65.png Center Center Fill Tile D:\ Files\ Yuki\ Documents\ aizawa-hikaru.png Both Uniform Right Bottom
In my implementation, I used two ways to draw the background: one uses the Image control to be compatible with the ItaBackgroundImage written by the Japanese, and the other uses ImageBrush, which allows you to choose whether to use Tile or not.
I need to be clear here, because I am not familiar with the unit conversion of pictures, if I choose a different picture from the DPI on the screen when pixel mode is enabled (for example, the haoren65.png-- I used is the background image I made for some entertainment purpose a few years ago), there may be phenomena such as the image being shrunk or stretched.
Since I'm just new to Visual Studio 2010 extension development, I can't do anything about dialogs and things like that for the time being. The configuration file also uses XML serialization instead of the orthodox ConfigurationSection+ConfigurationManager mode (I'll fix it in the next version-if there's a next version).
Here is a mention:
Var xs = new XmlSerializer (typeof (ItaConfig2), new XmlRootAttribute ("ItaBackgroundConfig2")); / / use XmlRootAttribute here to change the name of the root node var voidNamespaceMapping = new XmlSerializerNamespaces (); voidNamespaceMapping.Add ("", "); xs.Serialize (sw, config, voidNamespaceMapping); / / use an" almost "empty XmlSerializerNamespaces here to remove unnecessary namespace generated during serialization. The above is all the content of the article "how to add background pictures to Visual Studio 2010". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.