#1 2014-08-20 14:01:06

flavio_vsm
Member
Registered: 2014-08-20
Posts: 3

"canvas does not allow drawing" on SQLite3Pages

Hi.
When I run DrawText with a large string I got the error "canvas does not allow drawing" on line result := TMetafileCanvas.Create(Page,fPtrHdl); of function TGDIPages.CreateMetafileCanvas(Page: TMetafile): TMetafileCanvas; function.

Offline

#2 2014-08-20 14:49:30

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: "canvas does not allow drawing" on SQLite3Pages

I was not able to reproduce this  "canvas does not allow drawing" error, but we did have an exception in TrimLine() when calling DrawText() with huge text.

Sounds like if GetTextExtentExPointNoPartials() API is a bit slow, but at least we found out a new algorithm which should fix the issue.
See http://synopse.info/fossil/info/0447736743

Offline

#3 2014-08-22 12:00:05

flavio_vsm
Member
Registered: 2014-08-20
Posts: 3

Re: "canvas does not allow drawing" on SQLite3Pages

I managed to solve the problem.
I was calling SetPrinter after calling BeginDoc.
I changed SetPrinter to before BeginDoc and the problem stopped.

Offline

#4 2014-08-22 12:40:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,182
Website

Re: "canvas does not allow drawing" on SQLite3Pages

OK.

I've just added a documentation precision about the necessity to set the printer before TGdiPages.BeginDoc.

Offline

Board footer

Powered by FluxBB