GDI + Learning Record (21): Color

Source: Internet
Author: User
// Color transparency var G: tgpgraphics; SB: tgpsolidbrush; begin G: = tgpgraphics. create (canvas. handle); SB: = tgpsolidbrush. create (makecolor (128,255, 128); {indicates translucent} G. fillrectangle (SB, 10, 10, 100,100); sb. free; G. free; end;
 // Use the color type var G: tgpgraphics; SB: tgpsolidbrush; color: tgpcolor; {actually the color is DWORD type} begin G: = tgpgraphics. create (canvas. handle); color: = aclred; SB: = tgpsolidbrush. create (color); G. fillrectangle (SB, 10, 10, 100,100); sb. free; G. free; end;
 // Color mixing mode var G: tgpgraphics; P: tgppen; begin G: = tgpgraphics. create (canvas. handle); P: = tgppen. create (makecolor (128,255,), 20); G. setcompositingmode (compositingmodesourcecopy); {rewrite background color} G. drawline (p, 11, 11, 111,111); G. setcompositingmode (compositingmodesourceover); {mixed background color, default value} G. drawline (p, 66,11, 222,128); p. free; G. free; end;
 

Color Mixing Mode:

Delphi Microsoft Description
Compositingmodesourcecopy Sourcecopy Specifies that the background color is rewritten when the color is rendered.
Compositingmodesourceover Sourceover Specifies that the color is mixed with the background color when it is rendered. This mixture is composed
Determine the Alpha component.

GDI + color constant:

Delphi Microsoft Description
Aclactiveborder Activeborder The System-defined color of the border of the activity window.
Aclactivecaption Activecaption The System-defined color of the background in the title bar of the activity window.
Aclactivecaptiontext Activecaptiontext The System-defined color of the text in the title bar of the activity window.
Aclaliceblue Aliceblue
Aclantiquewhite Antiquewhite
Aclappworkspace Appworkspace The System-defined color of the application workspace. The application workspace is an area not occupied by documents in the Multi-document view.
Aclaqua Aqua
Aclaquamarine Aquamarine
Aclazure Azure
Aclbeige Beige
Aclbisque Bisque
Aclblack Black
Aclblanchedalmond Blanchedalmond
Aclblue Blue
Aclblueviolet Bluevilet
Aclbrown Brown
Aclburlywood Burlywood
Aclbuttonface Buttonface The system defines the surface color of 3D elements.
Aclbuttonhighlight Buttonhighlight The color defined by the system, which is the highlight color of three-dimensional elements. This color is applied to the area where 3D elements face light sources.
Aclbuttonshadow Buttonshadow The color defined by the system is the shadow color of three-dimensional elements. This color is applied to the back-to-source part of a 3D element.
Aclcadetblue Cadetblue
Aclchartreuse Chartreuse
Aclchocolate Chocolate
Aclcontrol Control The system defines the surface color of 3D elements.
Aclcontroldark Controldark The system defines the shadow color of 3D elements. The shadow color is applied to the back-to-source of 3D elements.
Aclcontroldarkdark Controldarkdark The color defined by the system is the dark shadow color of three-dimensional elements. The dark shadow color is applied to the deepest part of 3D elements.
Aclcontrollight Controllight The color defined by the system is the light color of three-dimensional elements. The light color is applied to the light source of 3D elements.
Aclcontrollightlight Controllightlight The system defines the highlight color of a 3D element. The highlight color is applied to the brightest part of a 3D element.
Aclcontroltext Controltext The System-defined color of text in 3D elements.
Aclcoral Coral
Aclcornflowerblue Cornflowerblue
Aclcornsilk Cornsilk
Aclcrimson Crimson
Aclcyan Cyan
Acldarkblue Darkblue
Acldarkcyan Darkcyan
Acldarkgoldenrod Darkgoldenrod
Acldarkgray Darkgray
Acldarkgreen Darkgreen
Acldarkkhaki Darkkhaki
Acldarkmagenta Darkmagenta
Acldarkolivegreen Darkolivegreen
Acldarkorange Darkorange
Acldarkorchid Darkorchid
Acldarkred Darkred
Acldarksalmon Darksalmon
Acldarkseagreen Darkseagreen
Acldarkslateblue Darkslateblue
Acldarkslategray Darkslategray
Acldarkturquoise Darkturquoise
Acldarkviolet Darkviotlet
Acldeeppink Deeppink
Acldeepskyblue Deepskyblue
Acldesktop Desktop The System-defined color of the desktop.
Acldimgray Dimgray
Acldodgerblue Dodgerblue
Aclfirebrick Firebrick
Aclfloralwhite Floralwhite
Aclforestgreen Forestgreen
Aclfuchsia Fuchsia
Aclgainsboro Gainsboro
Aclghostwhite Ghostwhite
Aclgold Gold
Aclgoldenrod Goldenrod
Aclgradientactivecaption Gradientactivecaption The System-defined color that is the brightest in the color gradient in the title bar of the activity window.
Aclgradientinactivecaption Gradientinactivecaption The System-defined color that is the brightest in the color gradient in the title bar of the inactive window.
Aclgray Gray
Aclgraytext Graytext The System-defined color of light gray text. Items in the list are displayed in light gray text.
Aclgreen Green
Aclgreenyellow Greenyellow
Aclhighlight Highlight The System-defined color of the selected background. The selected items include the selected menu items and selected text.
Aclhighlighttext Highlighttext The System-defined color of the selected item text.
Aclhoneydew Honeydew
Aclhotpink Hotpink
Aclhottrack Hottrack The System-defined color used to specify the hot tracking item. Click a hot tracking item to execute this item.
Aclinactiveborder Inactiveborder The System-defined color of the inactive window border.
Aclinactivecaption Inactivecaption The System-defined color of the background of the inactive window title bar.
Aclinactivecaptiontext Inactivecaptiontext The System-defined color of the text in the title bar of the inactive window.
Aclindianred Indianred
Aclindigo Indigo
Aclinfo Info The System-defined color of the tooltip background.
Aclinfotext Infotext The System-defined color of the tooltip text.
Aclivory Ivory
Aclkhaki Khaki
Acllavender Lavender
Acllavenderblush Lavenderblush
Acllawngreen Lawngreen
Acllemonchiffon Lemonchiffon
Acllightblue Lightblue
Acllightcoral Lightcoral
Acllightcyan Lightcyan
Acllightgoldenrodyellow Lightgoldenrodyellow
Acllightgray Lightgray
Acllightgreen Lightgreen
Acllightpink Lightpink
Acllightsalmon Lightsalmon
Acllightseagreen Lightseagreen
Acllightskyblue Lightskyblue
Acllightslategray Lightslategray
Acllightsteelblue Lightsteelblue
Acllightyellow Lightyellow
Acllime Lime
Acllimegreen Limegreen
Acllinen Linen
Aclmagenta Magenta
Aclmaroon Maroon
Aclmediumaquamarine Mediumaquamarine
Aclmediumblue Mediumblue
Aclmediumorchid Mediumorchid
Aclmediumpurple Mediumpurple
Aclmediumseagreen Mediumseagreen
Aclmediumslateblue Mediumslateblue
Aclmediumspringgreen Mediumspringgreen
Aclmediumturquoise Mediumturquoise
Aclmediumvioletred Mediumvioletred
Aclmenu Menu The System-defined color of the menu background.
Aclmenubar Menubar The System-defined color of the menu bar background.
Aclmenuhighlight Menuhighlight When a menu is displayed, the System-defined color of the menu item is highlighted.
Aclmenutext Menutext The System-defined color of the menu text.
Aclmidnightblue Midnightblue
Aclmintcream Mintcream
Aclmistyrose Mistyrose
Aclmoccasin Moccasin
Aclnavajowhite Navajowhite
Aclnavy Navy
Aclold.pdf Oldlace
Aclolive Olive
Aclolivedrab Olivedrab
Aclorange Orange
Aclorangered Orangered
Aclorchid Orchid
Aclpalegoldenrod Palegoldenrod
Aclpalegreen Palegreen
Aclpaleturquoise Paleturquoise
Aclpalevioletred Palevioletred
Aclpapayawhip Papayawhip
Aclpeachpuff Peachpuff
Aclperu Peru
Aclpink Pink
Aclplum Plum
Aclpowderblue Powderblue
Aclpurple Purple
Aclred Red
Aclrosybrown Rosybrown
Aclroyalblue Royalblue
Aclsaddlebrown Saddlebrown
Aclsalmon Salmon
Aclsandybrown Sandybrown
Aclscrollbar Scrollbar The System-defined color of the scroll bar background.
Aclseagreen Seagreen
Aclseashell Seashell
Aclsienna Sienna
Aclsilver Silver
Aclskyblue Skyblue
Aclslateblue Slateblue
Aclslategray Slategray
Aclsnow Snow
Aclspringgreen Springgreen
Aclsteelblue Steelblue
Acltan Tan
Aclteal Teal
Aclthistle Thistle
Acltomato Tomato
Acltransparent Transparent
Aclturquoise Turquoise
Aclviolet Viotlet
Aclwheat Wheat
Aclwhite White
Aclwhitesmoke Whitesmoke
Aclwindow Window The System-defined color of the background in the work area of the window.
Aclwindowframe Windowframe The System-defined color of the window frame.
Aclwindowtext Windowtext The System-defined color of the text in the workspace of the window.
Aclyellow Yellow
Aclyellowgreen Yellowgreen

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.