Board index » delphi » Polypolygon

Polypolygon

Hi,
I need to draw a polygon with holes on a Timage canvas.
Using Polypolygon function seems to be the solution,
and It works fine an empty Timage, but ...
if a bitmap has been previously loaded in this Timage, nothing happen !
So, it's not possible to draw my polygons on top of a bitmap.
Who has ideas or experiences about that ?
Thanks in advance,
C.G.
 

Re:Polypolygon


Just a couple of suggestions:

- did you set the Modified flag for the bitmap after drawing?
- are you sure you are using the TImage.Bitmap.Canvas to draw on?

It sounds as if you are drawing on the TImage's canvas, and not on the
attached bitmap.

If that doesn't solve the problem, perhaps show a short code snippet?

Cheers,
David

Quote
"cg" <c.gat...@brgm.fr> wrote in message news:3CD233F4.2D5CD6D2@brgm.fr...
> Hi,
> I need to draw a polygon with holes on a Timage canvas.
> Using Polypolygon function seems to be the solution,
> and It works fine an empty Timage, but ...
> if a bitmap has been previously loaded in this Timage, nothing happen !
> So, it's not possible to draw my polygons on top of a bitmap.
> Who has ideas or experiences about that ?
> Thanks in advance,
> C.G.

Re:Polypolygon


Of course, the modified flag ...
Sorry for such a bad question and thanks for your help.
C.G.
Quote
David J Taylor wrote:
> Just a couple of suggestions:

> - did you set the Modified flag for the bitmap after drawing?
> - are you sure you are using the TImage.Bitmap.Canvas to draw on?

> It sounds as if you are drawing on the TImage's canvas, and not on the
> attached bitmap.

> If that doesn't solve the problem, perhaps show a short code snippet?

> Cheers,
> David

> "cg" <c.gat...@brgm.fr> wrote in message news:3CD233F4.2D5CD6D2@brgm.fr...
> > Hi,
> > I need to draw a polygon with holes on a Timage canvas.
> > Using Polypolygon function seems to be the solution,
> > and It works fine an empty Timage, but ...
> > if a bitmap has been previously loaded in this Timage, nothing happen !
> > So, it's not possible to draw my polygons on top of a bitmap.
> > Who has ideas or experiences about that ?
> > Thanks in advance,
> > C.G.

Re:Polypolygon


Well, no, a good question.  To me, it's never obvious when to set the
Modified flag.  I mean, wouldn't you expect that any drawing operation on
the Canvas should tell the owner of the Canvas that it may have changed.
Perhaps someone could enlighten me why that flag exists - is it because
the Canvas doesn't know who owns it?
Quote
"cg" <c.gat...@brgm.fr> wrote in message news:3CD23E3E.5C6F6AD6@brgm.fr...
> Of course, the modified flag ...
> Sorry for such a bad question and thanks for your help.
> C.G.

Re:Polypolygon


Quote
In article <3cd24229_1@dnews>, David J Taylor wrote:
> I mean, wouldn't you expect that any drawing operation on
> the Canvas should tell the owner of the Canvas that it may have changed.
> Perhaps someone could enlighten me why that flag exists - is it because
> the Canvas doesn't know who owns it?

Is TCanvas.PolyPolygon new in D6?

Gordon

Other Threads