A Sample Extension: Color Selector

To cap this discussion of add-ins, let’s look at the process of developing a functioning package from start to finish. This extension is a color picker. It enables users to click an area of a color palette, and the package emits code to create an instance of a color structure that matches the selected color from the palette. Here is a summary list of requirements for the add-in:

Image In a tool window, it displays a visual color palette representing all the possible colors.

Image As the mouse pointer is moved over the palette, the control displays the Red, Green, and Blue values for the point directly under the mouse pointer.

Image If a user clicks the palette, it takes the current RGB values and copies the correct C# code to implement a matching Color struct onto the clipboard so that it can be easily pasted into an open code window.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset