Recent

Author Topic: draw into Tpanel  (Read 5941 times)

airpas

  • Full Member
  • ***
  • Posts: 179
draw into Tpanel
« on: November 16, 2012, 09:11:05 pm »
how could you draw into TPanel
i can't see any  .create(handle)




Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: draw into Tpanel
« Reply #1 on: November 16, 2012, 10:28:46 pm »
TPanel is not for drawing, use TPaintBox (or TForm if you prefer to draw on the whole form) for that.

airpas

  • Full Member
  • ***
  • Posts: 179
Re: draw into Tpanel
« Reply #2 on: November 18, 2012, 01:24:15 pm »
now its clear
image.draw(canvas...)
 canvas could be tpanel , tpaintbox, tform

but why tpanel is not for drawing ?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: draw into Tpanel
« Reply #3 on: November 18, 2012, 02:40:40 pm »
Quote
but why tpanel is not for drawing ?
As its name suggests, TPanel is a container of controls. Not a container of arbitrary drawing. You can still however paint to it, by creating a descendant control and override the Paint method. Probably through this you'll understand why it has no OnPaint event (which a control for true drawing has).

lainz

  • Guest
Re: draw into Tpanel
« Reply #4 on: November 26, 2012, 01:32:17 am »
use BGRAControls TBGRAVirtualScreen (like TPanel) or TBGRAGraphicControl (like TPaintBox).

 

TinyPortal © 2005-2018