Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-15 Thread Graeme Geldenhuys
On 7/15/06, Mattias Gaertner [EMAIL PROTECTED] wrote: So the TGraphicsControl.Canvas is a clipping window to the parent canvas. Yes. I will update the LCL documentation with my new found knowledge! :-) Thanks to everybody that replied. Graeme. -- There's no place like 127.0.0.1

[lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Graeme Geldenhuys
Hi, I am creating a custom component and need to draw Arc's and Ellipses. I place the custom component on the form and make it square (H:150, W:150). I then found that drawing the Arc's and Ellipses are off to the right. I then added debug code to my component, to print the components

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Micha Nelissen
Graeme Geldenhuys wrote: Hi, I am creating a custom component and need to draw Arc's and Ellipses. I place the custom component on the form and make it square (H:150, W:150). I then found that drawing the Arc's and Ellipses are off to the right. I then added debug code to my component, to

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Graeme Geldenhuys
A canvas has infinite size. It's just clipped and translated into a certain window. This window (or bitmap) has a certain size, so when querying the canvas you get the size of that. It's normal behaviour. Micha I am no graphics guru and that makes no sence! :-) The GraphicControl has a

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread ik
On 7/14/06, Graeme Geldenhuys [EMAIL PROTECTED] wrote: A canvas has infinite size. It's just clipped and translated into a certain window. This window (or bitmap) has a certain size, so when querying the canvas you get the size of that. It's normal behaviour. Micha I am no graphics guru

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Graeme Geldenhuys
On 7/14/06, ik [EMAIL PROTECTED] wrote: You should have the ClinetWidth and ClientHeight, that will have different width and height then the canvas one... that's how it done on Delphi. For now I use the self.ClientRect and work from there... The Canvas thing still puzzles me though - the

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread ik
On 7/14/06, Graeme Geldenhuys [EMAIL PROTECTED] wrote: On 7/14/06, ik [EMAIL PROTECTED] wrote: You should have the ClinetWidth and ClientHeight, that will have different width and height then the canvas one... that's how it done on Delphi. For now I use the self.ClientRect and work from

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Micha Nelissen
Graeme Geldenhuys wrote: I am no graphics guru and that makes no sence! :-) Well, it's the windows drawing model, so that may have to do with it ;-). The GraphicControl has a private FCanvas, and that is what I wanted to But the canvas isn't owned by the graphiccontrol, but by its parent.

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Graeme Geldenhuys
On 7/14/06, ik [EMAIL PROTECTED] wrote: Lets assume you are creating a game, and needs scrolling map... what is prefed: 1. draw what you display ? 2. Store the whole map and display what you need ? So the TGraphicsControl.Canvas is a clipping window to the parent canvas. G. -- There's no

Re: [lazarus] TGraphicControl and Canvas.Width

2006-07-14 Thread Mattias Gaertner
On Fri, 14 Jul 2006 13:19:46 +0200 Graeme Geldenhuys [EMAIL PROTECTED] wrote: On 7/14/06, ik [EMAIL PROTECTED] wrote: Lets assume you are creating a game, and needs scrolling map... what is prefed: 1. draw what you display ? 2. Store the whole map and display what you need ? So the