Problem creating hatch brush

If you are a C/C++/C# developer and have any questions about using our products from your application here is the place to post them.
Post Reply
sprezzatura
Posts: 46
Joined: Fri Nov 18 2005
Location: Nova Scotia

Problem creating hatch brush

Post by sprezzatura »

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
sprezzatura
Posts: 46
Joined: Fri Nov 18 2005
Location: Nova Scotia

Hatch brush question

Post by sprezzatura »

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.

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);
}
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

I guess the PDF Converter doesn't support hatch bursh for the moment but don't consider this as a final answer, i will check this with our developers and get back to you.
sprezzatura
Posts: 46
Joined: Fri Nov 18 2005
Location: Nova Scotia

Hatch brushes - yea or nay?

Post by sprezzatura »

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
agmns
Posts: 1
Joined: Fri Jan 27 2006
Location: Nova Scotia

Hatch Brush

Post by agmns »

We too have the same problem. Our only solution for the moment was to use a solid fill.
Post Reply