Board index » delphi » extcreatepen problem - Win 95

extcreatepen problem - Win 95

On NT this works fine, the only problem I'm having is on Win 95.
I am trying to draw on the canvas using both square and circular pens.
Chris Hill gave me the advice to use extcreatepen with the pen style
being
PS_GEOMETRIC OR PS_SOLID OR PS_ENDCAP_SQUARE
This works great on NT but on Win 95 the drawing still comes out round.
It comes out round on the Visible canvas, on the tbitmap canvas in the
background and also using
the API LineTo on a DC. does anyone know how how to get this to work in
Win 95? I've also tried using
PS_ENDCAP_FLAT but to no success.

Thanks
Sim

 

Re:extcreatepen problem - Win 95


Oops.  I usually remember to qualify any NT specific methods.

According to the help file PS_ENDCAP_SQUARE is only suppored when used
to draw paths in Win95.

You can surround the line drawing in a BeginPath/EndPath block and
call FillPath or StrokePath or StrokeAndFillPath.

{ Use ExtCreatePen as before, assign to Canvas.Pen.Handle }
with Canvas do begin
  BeginPath(Handle);
    MoveTo(10,10);
    LineTo(50,75);
  EndPath(Handle);
  FillPath(Handle);  { or StrokePath or StrokeAndFillPath }
end;

On Fri, 14 May 1999 09:20:57 -0400, Sim Zacks <sza...@imprsv.com>
wrote:

Quote
>On NT this works fine, the only problem I'm having is on Win 95.
>I am trying to draw on the canvas using both square and circular pens.
>Chris Hill gave me the advice to use extcreatepen with the pen style
>being
>PS_GEOMETRIC OR PS_SOLID OR PS_ENDCAP_SQUARE
>This works great on NT but on Win 95 the drawing still comes out round.
>It comes out round on the Visible canvas, on the tbitmap canvas in the
>background and also using
>the API LineTo on a DC. does anyone know how how to get this to work in
>Win 95? I've also tried using
>PS_ENDCAP_FLAT but to no success.

>Thanks
>Sim

Chris Hill
Chris...@aol.com

Re:extcreatepen problem - Win 95


I had read the things about paths, but I didn't know that it was any
different than LineTo so I just ignored it.
Thanks
Quote
Chris Hill wrote:
> Oops.  I usually remember to qualify any NT specific methods.

> According to the help file PS_ENDCAP_SQUARE is only suppored when used
> to draw paths in Win95.

> You can surround the line drawing in a BeginPath/EndPath block and
> call FillPath or StrokePath or StrokeAndFillPath.

> { Use ExtCreatePen as before, assign to Canvas.Pen.Handle }
> with Canvas do begin
>   BeginPath(Handle);
>     MoveTo(10,10);
>     LineTo(50,75);
>   EndPath(Handle);
>   FillPath(Handle);  { or StrokePath or StrokeAndFillPath }
> end;

> On Fri, 14 May 1999 09:20:57 -0400, Sim Zacks <sza...@imprsv.com>
> wrote:

> >On NT this works fine, the only problem I'm having is on Win 95.
> >I am trying to draw on the canvas using both square and circular pens.
> >Chris Hill gave me the advice to use extcreatepen with the pen style
> >being
> >PS_GEOMETRIC OR PS_SOLID OR PS_ENDCAP_SQUARE
> >This works great on NT but on Win 95 the drawing still comes out round.
> >It comes out round on the Visible canvas, on the tbitmap canvas in the
> >background and also using
> >the API LineTo on a DC. does anyone know how how to get this to work in
> >Win 95? I've also tried using
> >PS_ENDCAP_FLAT but to no success.

> >Thanks
> >Sim

> Chris Hill
> Chris...@aol.com

Other Threads