My application fills a rectangle with a hatched brush (diagonals).
The hatching appears when I print directly to the printer, but does not appear when output to PDF. Instead, the rectangles are filled with white in the PDF document.
I use something like:
HBRUSH brush = CreateHatchBrush(HS_BDIAGONAL, RGB(255,0,0));
SelectObject(hdc, brush);
...then I draw a Rectangle.
Also fails with HS_CROSS style.
I'm using PDF Converter 2.50f. Please tell me Converter supports hatching?
Thanks
Problem creating hatch brush
-
- Posts: 46
- Joined: Fri Nov 18 2005
- Location: Nova Scotia
-
- Posts: 46
- Joined: Fri Nov 18 2005
- Location: Nova Scotia
Hatch brush question
Here's an update: If you splice the code below in a sample MFC project, that also interfaces to PDF Converter, and create a PDF document, you get an error message:
Could not find the pattern named ".
...when displaying it with Adobe.
Could not find the pattern named ".
...when displaying it with Adobe.
Code: Select all
void CTestHatchAmyuniView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
CBrush brushBlue(HS_BDIAGONAL, RGB(0, 0, 255));
CBrush* pOldBrush = pDC->SelectObject(&brushBlue);
// create and select a thick, black pen
CPen penBlack;
penBlack.CreatePen(PS_SOLID, 3, RGB(0, 0, 0));
CPen* pOldPen = pDC->SelectObject(&penBlack);
// get our client rectangle
CRect rect(300, 300, 600, 600);
// draw a thick black rectangle filled with blue
pDC->Rectangle(rect);
// put back the old objects
pDC->SelectObject(pOldBrush);
pDC->SelectObject(pOldPen);
CView::OnPrint(pDC, pInfo);
}
-
- Posts: 46
- Joined: Fri Nov 18 2005
- Location: Nova Scotia
Hatch brushes - yea or nay?
Hi there to the kind folks at Amyuni -
I need an answer real soon to this hatch brush question - we're just a few weeks away from release, and I have to deal with this issue.
Thanks,
Pierre
I need an answer real soon to this hatch brush question - we're just a few weeks away from release, and I have to deal with this issue.
Thanks,
Pierre
Hatch Brush
We too have the same problem. Our only solution for the moment was to use a solid fill.