TImage drawing not showing up on Form. lazarus / 39-Graphics ---------------------------------------------------------------------- cov · 2013-09-22 09:10 I have a Timage on my form. Code: [Select]  Form1.Top:=524;   Form1.Left:=450;   Form1.Width:=202;   Form1.Height:=52;   Image1.Top:=Form1.Top;   Image1.Left:=Form1.Left;   Image1.Width:=Form1.Width;   Image1.Height:=Form1.Height;  If I try this: Code: [Select]  Image1.Canvas.Brush.Color:=clRed;   Image1.Canvas.FillRect(0,0,200,25); Nothing happens. I'm expecting the form (which has Borderstyle bsNone) to be painted red. Instead, it remains grey. Lazarus 1.0.10 r41613 FPC 2.6.2 i386-win32-win32/win64 ---------------------------------------------------------------------- taazz · 2013-09-22 09:34 TImage has no canvas per see it forwards all canvas operations to the picture it has if no picture is loaded then a tbitmap is used by default. What you see is the results of having a Tbitmap with no size at all. Try to set the Image1.Picture.Bitmap.Width/Height to the appropriate size before drawing anything. Keep in mind that the size of the timage and the size of the Image1.Picture can vary and TImage has code to transform the picture (stretch proportional etc) to fit the bounds set by the TImage. ---------------------------------------------------------------------- cov · 2013-09-22 09:50 Thanks for your response, Taaz. I've added Code: [Select]  Image1.Picture.Bitmap.SetSize(200,50); after setting the Form size, but it doesn't help. OTOH, if I set the size of the Form as follows: Code: [Select]  Form1.Top:=0;   Form1.Left:=0;   Form1.Width:=1200;   Form1.Height:=1000;  then I can see my red rectangle at the top left of the form. ---------------------------------------------------------------------- taazz · 2013-09-22 09:57 You have to remember that the TImage boundaries are proportional to the upper left corner of the form so image top left must be set to 0 other wise it will place the image outside the form boundaries. ---------------------------------------------------------------------- cov · 2013-09-22 10:13 Yes, I thought it was something like that, but couldn't get my head around it. What I did was increase the size of the form to 0,0 (top, left), 1200,1000(width, height) and the red rectangle appeared in the top left corner. Then I changed the size to 524,0 ; 1200,1000, and the rectangle was still there. So I changed the size to 524,450; 1200,1000. So far so good. then decreasing the width and height to 200 and 50 respectively and now the red rectangle is displaying as expected. I'm a bit nonplussed! I could have sworn the code hasn't changed, but it now works!