Hatch brushes in TCanvas work incorrectly |
The hatch brushes in TCanvas work incorrectly if the brush color is set to clGray. Windows 9x doesn´t draw the brush hatched if the background color is equal to the brush color. Therefore, the CreateBrush method of TCanvas set the background color for the hatch brush by the following way: SetBkColor(FHandle, not ColorToRGB(Brush.Color)); However, this way does not work if the brush color is equal to clGray. For solving this problem can be used the following function: void __fastcall BrushCorrection (TCanvas *ACanvas)
{
if (ACanvas->Brush->Style != bsSolid && ACanvas->Brush->Color == clGray)
{
SetBkColor (ACanvas->Handle,ColorToRGB (clWhite));
}
}
BrushCorrection should be called before the TCanvas methods that can use the hatch brush. Nikolay Antonov & Vyatcheslav Baranov. MBLab, 9/14/2001. |
| Home - Company - Sources - Products - Download - Order - Support - Forums - Contact |
| Copyright © 2001-2004 MBLabSoft. All Rights Reserved. |