扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:coffer编译 来源:VCKBASE 2007年11月16日
关键字:
public: HatchBrush(HatchStyle style, Color foreColor); |
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e) { using namespace System::Drawing::Drawing2D; HatchBrush *brushBackDiag = new HatchBrush(HatchStyle::BackwardDiagonal, Color::FromArgb(0, 0, 255)); HatchBrush *brushCross = new HatchBrush(HatchStyle::Cross, Color::FromArgb(200, 0, 0)); HatchBrush *brushDarkDown = new HatchBrush(HatchStyle::DarkDownwardDiagonal, Color::Salmon); HatchBrush *brushDarkHorz = new HatchBrush(HatchStyle::DarkHorizontal, Color::Navy); HatchBrush *brushDarkUpDiag = new HatchBrush(HatchStyle::DarkUpwardDiagonal, Color::Pink); HatchBrush *brushVertical = new HatchBrush(HatchStyle::DarkVertical, Color::FromArgb(255, 0, 255)); HatchBrush *brushDashDnDiag = new HatchBrush( HatchStyle::DashedDownwardDiagonal, Color::FromArgb(255, 128, 0)); HatchBrush *brushDashHorz = new HatchBrush(HatchStyle::DashedHorizontal, Color::FromArgb(0, 128, 192)); HatchBrush *brushDashUpDiag = new HatchBrush(HatchStyle::DashedUpwardDiagonal, Color::Green); HatchBrush *brushDashVert = new HatchBrush(HatchStyle::DashedVertical, Color::Firebrick); HatchBrush *brushDiagBrisk = new HatchBrush(HatchStyle::DiagonalBrick, Color::Fuchsia); HatchBrush *brushDiagCross = new HatchBrush(HatchStyle::DiagonalCross, Color::Moccasin); HatchBrush *brushDivot = new HatchBrush(HatchStyle::Divot, Color::Goldenrod); HatchBrush *brushDotDiamond = new HatchBrush(HatchStyle::DottedDiamond, Color::Gainsboro); HatchBrush *brushDottedGrid = new HatchBrush(HatchStyle::DottedGrid, Color::Khaki); HatchBrush *brushForDiag = new HatchBrush(HatchStyle::ForwardDiagonal, Color::Maroon); HatchBrush *brushHorz = new HatchBrush(HatchStyle::Horizontal, Color::Red); HatchBrush *brushHorzBrick = new HatchBrush(HatchStyle::HorizontalBrick, Color::SaddleBrown); HatchBrush *brushLgChkBoard = new HatchBrush(HatchStyle::LargeCheckerBoard, Color::RoyalBlue); HatchBrush *brushLgConfetti = new HatchBrush(HatchStyle::LargeConfetti, Color::MistyRose); HatchBrush *brushLgGrid = new HatchBrush(HatchStyle::LargeGrid, Color::Purple); HatchBrush *brushLtDnDiag = new HatchBrush( HatchStyle::LightDownwardDiagonal, Color::DarkCyan); HatchBrush *brushLtHorz = new HatchBrush(HatchStyle::LightHorizontal, Color::PowderBlue); HatchBrush *brushUpDiag = new HatchBrush( HatchStyle::LightUpwardDiagonal, Color::SeaGreen); HatchBrush *brushLtVert = new HatchBrush(HatchStyle::LightVertical, Color::Olive); e->Graphics->FillRectangle(brushBackDiag, 20, 20, 80, 60); e->Graphics->FillRectangle(brushCross, 120, 20, 80, 60); e->Graphics->FillRectangle(brushDarkDown, 220, 20, 80, 60); e->Graphics->FillRectangle(brushDarkHorz, 320, 20, 80, 60); e->Graphics->FillRectangle(brushDarkUpDiag, 420, 20, 80, 60); e->Graphics->FillRectangle(brushVertical, 20, 100, 80, 60); e->Graphics->FillRectangle(brushDashDnDiag, 120, 100, 80, 60); e->Graphics->FillRectangle(brushDashHorz, 220, 100, 80, 60); e->Graphics->FillRectangle(brushDashUpDiag, 320, 100, 80, 60); e->Graphics->FillRectangle(brushDashVert, 420, 100, 80, 60); e->Graphics->FillRectangle(brushDashVert, 20, 180, 80, 60); e->Graphics->FillRectangle(brushDiagBrisk, 120, 180, 80, 60); e->Graphics->FillRectangle(brushDiagCross, 220, 180, 80, 60); e->Graphics->FillRectangle(brushDivot, 320, 180, 80, 60); e->Graphics->FillRectangle(brushDotDiamond, 420, 180, 80, 60); e->Graphics->FillRectangle(brushDottedGrid, 20, 260, 80, 60); e->Graphics->FillRectangle(brushForDiag, 120, 260, 80, 60); e->Graphics->FillRectangle(brushHorz, 220, 260, 80, 60); e->Graphics->FillRectangle(brushHorzBrick, 320, 260, 80, 60); e->Graphics->FillRectangle(brushLgChkBoard, 420, 260, 80, 60); e->Graphics->FillRectangle(brushLgGrid, 20, 340, 80, 60); e->Graphics->FillRectangle(brushLtDnDiag, 120, 340, 80, 60); e->Graphics->FillRectangle(brushLtHorz, 220, 340, 80, 60); e->Graphics->FillRectangle(brushUpDiag, 320, 340, 80, 60); e->Graphics->FillRectangle(brushLtVert, 420, 340, 80, 60); } |
图三、各种网络格画刷效果图 |
public: HatchBrush(HatchStyle hatchstyle, Color foreColor, Color backColor); |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。