📄 gdipluspath.h
字号:
{
INT count;
SetStatus(DllExports::GdipGetPathGradientPointCount(
(GpPathGradient*) nativeBrush, &count));
return count;
}
INT GetSurroundColorCount() const
{
INT count;
SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
(GpPathGradient*) nativeBrush, &count));
return count;
}
Status GetSurroundColors(OUT Color* colors,
IN OUT INT* count) const
{
if(colors == NULL || count == NULL)
{
return SetStatus(InvalidParameter);
}
INT count1;
SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
(GpPathGradient*) nativeBrush, &count1));
if(lastResult != Ok)
return lastResult;
if((*count < count1) || (count1 <= 0))
return SetStatus(InsufficientBuffer);
ARGB* argbs = (ARGB*) new ARGB[count1];
if(argbs == NULL)
return SetStatus(OutOfMemory);
SetStatus(DllExports::GdipGetPathGradientSurroundColorsWithCount(
(GpPathGradient*)nativeBrush, argbs, &count1));
if(lastResult == Ok)
{
for(INT i = 0; i < count1; i++)
{
colors[i].SetValue(argbs[i]);
}
*count = count1;
}
delete [] argbs;
return lastResult;
}
Status SetSurroundColors(IN const Color* colors,
IN OUT INT* count)
{
if(colors == NULL || count == NULL)
{
return SetStatus(InvalidParameter);
}
INT count1 = GetPointCount();
if((*count > count1) || (count1 <= 0))
return SetStatus(InvalidParameter);
count1 = *count;
ARGB* argbs = (ARGB*) new ARGB[count1];
if(argbs == NULL)
return SetStatus(OutOfMemory);
for(INT i = 0; i < count1; i++)
{
argbs[i] = colors[i].GetValue();
}
SetStatus(DllExports::GdipSetPathGradientSurroundColorsWithCount(
(GpPathGradient*)nativeBrush, argbs, &count1));
if(lastResult == Ok)
*count = count1;
delete [] argbs;
return lastResult;
}
Status GetGraphicsPath(OUT GraphicsPath* path) const
{
if(path == NULL)
return SetStatus(InvalidParameter);
return SetStatus(DllExports::GdipGetPathGradientPath(
(GpPathGradient*)nativeBrush, path->nativePath));
}
Status SetGraphicsPath(IN const GraphicsPath* path)
{
if(path == NULL)
return SetStatus(InvalidParameter);
return SetStatus(DllExports::GdipSetPathGradientPath(
(GpPathGradient*)nativeBrush, path->nativePath));
}
Status GetCenterPoint(OUT PointF* point) const
{
return SetStatus(DllExports::GdipGetPathGradientCenterPoint(
(GpPathGradient*)nativeBrush,
point));
}
Status GetCenterPoint(OUT Point* point) const
{
return SetStatus(DllExports::GdipGetPathGradientCenterPointI(
(GpPathGradient*)nativeBrush,
point));
}
Status SetCenterPoint(IN const PointF& point)
{
return SetStatus(DllExports::GdipSetPathGradientCenterPoint(
(GpPathGradient*)nativeBrush,
&point));
}
Status SetCenterPoint(IN const Point& point)
{
return SetStatus(DllExports::GdipSetPathGradientCenterPointI(
(GpPathGradient*)nativeBrush,
&point));
}
Status GetRectangle(OUT RectF* rect) const
{
return SetStatus(DllExports::GdipGetPathGradientRect(
(GpPathGradient*)nativeBrush, rect));
}
Status GetRectangle(OUT Rect* rect) const
{
return SetStatus(DllExports::GdipGetPathGradientRectI(
(GpPathGradient*)nativeBrush, rect));
}
Status SetGammaCorrection(IN BOOL useGammaCorrection)
{
return SetStatus(DllExports::GdipSetPathGradientGammaCorrection(
(GpPathGradient*)nativeBrush, useGammaCorrection));
}
BOOL GetGammaCorrection() const
{
BOOL useGammaCorrection;
SetStatus(DllExports::GdipGetPathGradientGammaCorrection(
(GpPathGradient*)nativeBrush, &useGammaCorrection));
return useGammaCorrection;
}
INT GetBlendCount() const
{
INT count = 0;
SetStatus(DllExports::GdipGetPathGradientBlendCount(
(GpPathGradient*) nativeBrush, &count));
return count;
}
Status GetBlend(OUT REAL* blendFactors,
OUT REAL* blendPositions,
IN INT count) const
{
return SetStatus(DllExports::GdipGetPathGradientBlend(
(GpPathGradient*)nativeBrush,
blendFactors, blendPositions, count));
}
Status SetBlend(IN const REAL* blendFactors,
IN const REAL* blendPositions,
IN INT count)
{
return SetStatus(DllExports::GdipSetPathGradientBlend(
(GpPathGradient*)nativeBrush,
blendFactors, blendPositions, count));
}
INT GetInterpolationColorCount() const
{
INT count = 0;
SetStatus(DllExports::GdipGetPathGradientPresetBlendCount(
(GpPathGradient*) nativeBrush, &count));
return count;
}
Status SetInterpolationColors(IN const Color* presetColors,
IN const REAL* blendPositions,
IN INT count)
{
if ((count <= 0) || !presetColors)
{
return SetStatus(InvalidParameter);
}
ARGB* argbs = (ARGB*) new ARGB[count];
if(argbs)
{
for(INT i = 0; i < count; i++)
{
argbs[i] = presetColors[i].GetValue();
}
Status status = SetStatus(DllExports::
GdipSetPathGradientPresetBlend(
(GpPathGradient*) nativeBrush,
argbs,
blendPositions,
count));
delete[] argbs;
return status;
}
else
{
return SetStatus(OutOfMemory);
}
}
Status GetInterpolationColors(OUT Color* presetColors,
OUT REAL* blendPositions,
IN INT count) const
{
if ((count <= 0) || !presetColors)
{
return SetStatus(InvalidParameter);
}
ARGB* argbs = (ARGB*) new ARGB[count];
if (!argbs)
{
return SetStatus(OutOfMemory);
}
GpStatus status = SetStatus(DllExports::GdipGetPathGradientPresetBlend(
(GpPathGradient*)nativeBrush,
argbs,
blendPositions,
count));
for(INT i = 0; i < count; i++)
{
presetColors[i] = Color(argbs[i]);
}
delete [] argbs;
return status;
}
Status SetBlendBellShape(IN REAL focus,
IN REAL scale = 1.0)
{
return SetStatus(DllExports::GdipSetPathGradientSigmaBlend(
(GpPathGradient*)nativeBrush, focus, scale));
}
Status SetBlendTriangularShape(
IN REAL focus,
IN REAL scale = 1.0
)
{
return SetStatus(DllExports::GdipSetPathGradientLinearBlend(
(GpPathGradient*)nativeBrush, focus, scale));
}
Status GetTransform(OUT Matrix *matrix) const
{
return SetStatus(DllExports::GdipGetPathGradientTransform(
(GpPathGradient*) nativeBrush,
matrix->nativeMatrix));
}
Status SetTransform(IN const Matrix* matrix)
{
return SetStatus(DllExports::GdipSetPathGradientTransform(
(GpPathGradient*) nativeBrush,
matrix->nativeMatrix));
}
Status ResetTransform()
{
return SetStatus(DllExports::GdipResetPathGradientTransform(
(GpPathGradient*)nativeBrush));
}
Status MultiplyTransform(IN const Matrix* matrix,
IN MatrixOrder order = MatrixOrderPrepend)
{
return SetStatus(DllExports::GdipMultiplyPathGradientTransform(
(GpPathGradient*)nativeBrush,
matrix->nativeMatrix,
order));
}
Status TranslateTransform(IN REAL dx,
IN REAL dy,
IN MatrixOrder order = MatrixOrderPrepend)
{
return SetStatus(DllExports::GdipTranslatePathGradientTransform(
(GpPathGradient*)nativeBrush,
dx, dy, order));
}
Status ScaleTransform(IN REAL sx,
IN REAL sy,
IN MatrixOrder order = MatrixOrderPrepend)
{
return SetStatus(DllExports::GdipScalePathGradientTransform(
(GpPathGradient*)nativeBrush,
sx, sy, order));
}
Status RotateTransform(IN REAL angle,
IN MatrixOrder order = MatrixOrderPrepend)
{
return SetStatus(DllExports::GdipRotatePathGradientTransform(
(GpPathGradient*)nativeBrush,
angle, order));
}
Status GetFocusScales(OUT REAL* xScale,
OUT REAL* yScale) const
{
return SetStatus(DllExports::GdipGetPathGradientFocusScales(
(GpPathGradient*) nativeBrush, xScale, yScale));
}
Status SetFocusScales(IN REAL xScale,
IN REAL yScale)
{
return SetStatus(DllExports::GdipSetPathGradientFocusScales(
(GpPathGradient*) nativeBrush, xScale, yScale));
}
WrapMode GetWrapMode() const
{
WrapMode wrapMode;
SetStatus(DllExports::GdipGetPathGradientWrapMode(
(GpPathGradient*) nativeBrush, &wrapMode));
return wrapMode;
}
Status SetWrapMode(IN WrapMode wrapMode)
{
return SetStatus(DllExports::GdipSetPathGradientWrapMode(
(GpPathGradient*) nativeBrush, wrapMode));
}
private:
PathGradientBrush(const PathGradientBrush &);
PathGradientBrush& operator=(const PathGradientBrush &);
protected:
PathGradientBrush()
{
}
};
#endif // !_GRAPHICSPATH_HPP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -