UID | title | description | helpviewer_keywords | old-location | tech.root | ms.assetid | ms.date | ms.keywords | req.header | req.include-header | req.target-type | req.target-min-winverclnt | req.target-min-winversvr | req.kmdf-ver | req.umdf-ver | req.ddi-compliance | req.unicode-ansi | req.idl | req.max-support | req.namespace | req.assembly | req.type-library | req.lib | req.dll | req.irql | targetos | req.typenames | req.redist | req.product | ms.custom | f1_keywords | dev_langs | topic_type | api_type | api_location | api_name | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
NF:gdiplusbrush.LinearGradientBrush.SetWrapMode |
LinearGradientBrush::SetWrapMode (gdiplusbrush.h) |
The LinearGradientBrush::SetWrapMode method sets the wrap mode of this linear gradient brush. |
|
gdiplus\_gdiplus_CLASS_LinearGradientBrush_SetWrapMode_wrapMode_.htm |
gdiplus |
VS|gdicpp|~\gdiplus\gdiplusreference\classes\lineargradientbrushclass\lineargradientbrushmethods\setwrapmode_76wrapmode.htm |
12/05/2018 |
LinearGradientBrush class [GDI+],SetWrapMode method, LinearGradientBrush.SetWrapMode, LinearGradientBrush::SetWrapMode, SetWrapMode, SetWrapMode method [GDI+], SetWrapMode method [GDI+],LinearGradientBrush class, _gdiplus_CLASS_LinearGradientBrush_SetWrapMode_wrapMode_, gdiplus._gdiplus_CLASS_LinearGradientBrush_SetWrapMode_wrapMode_ |
gdiplusbrush.h |
Gdiplus.h |
Windows |
Windows XP, Windows 2000 Professional [desktop apps only] |
Windows 2000 Server [desktop apps only] |
Gdiplus.lib |
Gdiplus.dll |
Windows |
GDI+ 1.0 |
19H1 |
|
|
|
|
|
|
The LinearGradientBrush::SetWrapMode method sets the wrap mode of this linear gradient brush.
Type: WrapMode
Element of the WrapMode enumeration that specifies how areas painted with this linear gradient brush will be tiled. The value of this parameter must be one of the following elements:
- WrapModeTile
- WrapModeTileFlipX
- WrapModeTileFlipY
- WrapModeTileFlipXY
Type: Status
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
The boundary lines of a linear gradient brush form a tile. When you paint an area with a linear gradient brush, the tile repeats. A linear gradient brush may have alternate tiles flipped in a certain direction, as specified by the wrap mode. Flipping has the effect of reversing the order of the colors.
The wrap mode defaults to WrapModeTile when a LinearGradientBrush object is constructed.
The following example creates a linear gradient brush and uses it to fill a rectangle. Next, the code modifies the brush's wrap mode and uses the modified brush to fill another rectangle.
VOID Example_SetWrapMode(HDC hdc)
{
Graphics myGraphics(hdc);
LinearGradientBrush linGrBrush(
Rect(0, 0, 100, 50),
Color(255, 255, 0, 0), // red
Color(255, 0, 0, 255), // blue
LinearGradientModeHorizontal);
// Fill a large area using the gradient brush with the default wrap mode.
myGraphics.FillRectangle(&linGrBrush, 0, 0, 800, 50);
linGrBrush.SetWrapMode(WrapModeTileFlipX);
// Fill a large area using the gradient brush with the new wrap mode.
myGraphics.FillRectangle(&linGrBrush, 0, 75, 800, 50);
}