Board index » delphi » Drawing on top of OCX graphics component

Drawing on top of OCX graphics component

I have a third party OCX graphics component for viewing video in a Delphi App
that comes from a live video camera.

It does not have a public "canvas" property, but I want to draw circles and
lines on top of it anyway.

I tried placing a TImage on top of the OCX, thinking I could paint on it's
canvas, but the image is always behind the OCX.

However, some Delphi components can be placed right on top of the OCX.  For
example, I placed a button on top of the OCX, and the button was able to stay
there.  So whatever is drawing the button is obviously able to draw on top of
this OCX.

Any suggestions on how I might draw on top of the OCX, perhaps doing it the
"button way".

Thanks,

Carl.

 

Re:Drawing on top of OCX graphics component


Quote
"Carl Olsen" <carlol...@omax.com> wrote in message

news:3AE4979E.D38D7A3B@omax.com...

Quote

> I have a third party OCX graphics component for viewing video in a Delphi
App
> that comes from a live video camera.

> It does not have a public "canvas" property, but I want to draw circles
and
> lines on top of it anyway.

> I tried placing a TImage on top of the OCX, thinking I could paint on it's
> canvas, but the image is always behind the OCX.

> However, some Delphi components can be placed right on top of the OCX.
For
> example, I placed a button on top of the OCX, and the button was able to
stay
> there.  So whatever is drawing the button is obviously able to draw on top
of
> this OCX.

> Any suggestions on how I might draw on top of the OCX, perhaps doing it
the
> "button way".

Does a TPanel stay on top of it?  If so, I know you can create a new
component based on a TPanel (call it say TCanvasPanel) and expose the Canvas
property.  That way, you can draw & paint on it easily with Delphi after
you've dropped it onto the form....

....provided it *does* stay on top of the ActiveX control.

Regards
--
i l   *   m o d e r n o
quello che vedi quello che ottieni
-----------------------
http://mysite.ciaoweb.it/il-moderno/
il-mode...@ciaoweb.it

Re:Drawing on top of OCX graphics component


I'll give it a try.

Thanks,

Carl.

i l * m o d e r n o wrote:

Quote
> Does a TPanel stay on top of it?  If so, I know you can create a new
> component based on a TPanel (call it say TCanvasPanel) and expose the Canvas
> property.  That way, you can draw & paint on it easily with Delphi after
> you've dropped it onto the form....

> ....provided it *does* stay on top of the ActiveX control.

> Regards

Re:Drawing on top of OCX graphics component


Nope.  That does not work, or at least it does not in the manner that I tried to
impliment it.

When I change the "params" to tell Delphi that I want my panel to be
"WS_EX_Transparent", then suddenly it no longer is capable of staying on top of
the OCX, but instead gets over-drawn.

Any other suggestions?

Thanks,

Carl

procedure TClearPanel.CreateParams(var Params: TCreateParams);
{
  This is the part that allows the panel to be transparent, and prevents
  if from drawing a gray background.

Quote
}

begin

  {call the create of the params}
  inherited CreateParams(Params);
  Params.ExStyle:=Params.ExStyle+WS_EX_Transparent;
  ControlStyle:=ControlStyle-[csOpaque]+[csAcceptsControls];

end;

Quote
Carl Olsen wrote:
> I'll give it a try.

> Thanks,

> Carl.

> i l * m o d e r n o wrote:

> > Does a TPanel stay on top of it?  If so, I know you can create a new
> > component based on a TPanel (call it say TCanvasPanel) and expose the Canvas
> > property.  That way, you can draw & paint on it easily with Delphi after
> > you've dropped it onto the form....

> > ....provided it *does* stay on top of the ActiveX control.

> > Regards

Re:Drawing on top of OCX graphics component


Have a lot of free transparent forms components available from download on
the net, One suggestion is to put a transparent form in front of your image
and draw everthing you want on form Canvas.

This or anything else will work only if the video does not use directx to
acces the Screen.

I hope this helps

Quote
"Carl Olsen" <carlol...@omax.com> wrote in message

news:3AE6848C.60B57654@omax.com...
Quote

> Nope.  That does not work, or at least it does not in the manner that I
tried to
> impliment it.

> When I change the "params" to tell Delphi that I want my panel to be
> "WS_EX_Transparent", then suddenly it no longer is capable of staying on
top of
> the OCX, but instead gets over-drawn.

> Any other suggestions?

> Thanks,

> Carl

> procedure TClearPanel.CreateParams(var Params: TCreateParams);
> {
>   This is the part that allows the panel to be transparent, and prevents
>   if from drawing a gray background.
> }
> begin

>   {call the create of the params}
>   inherited CreateParams(Params);
>   Params.ExStyle:=Params.ExStyle+WS_EX_Transparent;
>   ControlStyle:=ControlStyle-[csOpaque]+[csAcceptsControls];

> end;

> Carl Olsen wrote:

> > I'll give it a try.

> > Thanks,

> > Carl.

> > i l * m o d e r n o wrote:

> > > Does a TPanel stay on top of it?  If so, I know you can create a new
> > > component based on a TPanel (call it say TCanvasPanel) and expose the
Canvas
> > > property.  That way, you can draw & paint on it easily with Delphi
after
> > > you've dropped it onto the form....

> > > ....provided it *does* stay on top of the ActiveX control.

> > > Regards

Other Threads