Recent

Author Topic: TGraphicCOntrol question about painting  (Read 1336 times)

jamie

  • Hero Member
  • *****
  • Posts: 5020
TGraphicCOntrol question about painting
« on: October 16, 2021, 11:58:41 pm »
I want to confirm what I have seen from poking around here that I can use a TGraphicControl class to draw an outline on top of an existing control, a TPaintBox for example, with no painting of its background so I can still see the underlayer of the parent,The Paintbox?

 I want to do this so I can capture all the mouse control when the cursor is within its boundaries but I still want the background control to show through except for where I made the drawing of the outline.

 You can think of this as a high light marker on an image of a TPaintbox but able to capture all mouse input within it.

  I know how to do this from the Windows API with transparent windows but I want something that works across the lake.


 
The only true wisdom is knowing you know nothing

lainz

  • Hero Member
  • *****
  • Posts: 3874
Re: TGraphicCOntrol question about painting
« Reply #1 on: October 17, 2021, 12:05:56 am »
TGraphicControl uses parent Canvas AFAIK. TPaintBox is TGraphicControl as well.

jamie

  • Hero Member
  • *****
  • Posts: 5020
Re: TGraphicCOntrol question about painting
« Reply #2 on: October 17, 2021, 12:19:19 am »
Yes, understood but It's getting hard to manage the mouse controls so I need an overlay..

The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018