Board index » delphi » CreatePolygonRgn Problems - Large areas don't clip properly.

CreatePolygonRgn Problems - Large areas don't clip properly.

Hi ...

Anybody know how the CreatePolygonRgn routine works?  I'm plotting to the
screen ok (usually), but when I print things out, it fails about 50% of the
time, usually with ugly results.  Any know bugs with the routine?  Any ideas
for a workaround?

Thanks in advance,

Jim Reed

 

Re:CreatePolygonRgn Problems - Large areas don't clip properly.


Quote
jr...@csn.net (Jim Reed) wrote:
>Hi ...
>Anybody know how the CreatePolygonRgn routine works?  I'm plotting to the
>screen ok (usually), but when I print things out, it fails about 50% of the
>time, usually with ugly results.  Any know bugs with the routine?  Any ideas
>for a workaround?
>Thanks in advance,
>Jim Reed

Can you post a minimal snippet, say triggered by
button1, that "fails"? What do you mean by "fails?"

AFAIK, CreatePlygonRgn is a direct pass-through
to Windows., as defined in WinProcs.pas. I.e.,

in the interface section:
  function CreatePolygonRgn(var Points; Count,
                        PolyFillMode: Integer): HRgn;
and in the implementation:
  function CreatePolygonRgn; external 'GDI' index 63;

Delphi Win API help says
------------------
Comments

The size of a region is limited to 32,767 by 32,767 logical units or
64K of memory, whichever is smaller.
...
--------------------

Are you bumping into that?

Ok, that's enough 20-questions for now.

Regards, Bengt Richter

Re:CreatePolygonRgn Problems - Large areas don't clip properly.


Quote
>The size of a region is limited to 32,767 by 32,767 logical units or
>64K of memory, whichever is smaller.
>...
>--------------------
>Are you bumping into that?

Without knowing the code, chances are YES. Windows 3.1 stores regions in a
ridiculous way (as a BIG bunch of rectangles). If the region is not
rectangular you will almost certainly run into storage problems.

I was severly burned by this once. WATCH OUT.

Win  95 handles odd  regions somewhat  better. (by taking memory from a larger
pool)

Re:CreatePolygonRgn Problems - Large areas don't clip properly.


Quote
>Without knowing the code, chances are YES. Windows 3.1 stores regions in a
>ridiculous way (as a BIG bunch of rectangles).

        Huh - I didn't know that. There are various ways a person could store
a region as a bunch of rectangles, some more efficient than others.

        Regarding "ridiculous", not that Mr. Bill needs my support, but how
would you store a region? A bunch of rectangles is surely smaller than a bunch
of points (essentially just a bitmap of the region). What's the non-ridiculous
way?

--
David Ullrich
Don't you guys find it tedious typing the same thing
after your signature each time you post something?
I know I do, but when in Rome...

Other Threads