How to find TImage picture left lazarus / 39-Graphics ---------------------------------------------------------------------- hello2hello · 2014-06-26 11:50 What I want to know is the left of the picture ( or canvas am unsure of the call ) within a TImage. The pictures attached demonstrate what information I need. The first picture is without the picture centered whereas the second is. It "moves" the picture to the center of the image. So I would like to know the left of the picture itself (not Image1), if I can access the width of the picture (not Image1) that would suffice. All in all the second picture where it says "what's this distance" is what I need to know. I cannot use Image1.picture.bitmap.width either due to the pixels per that picture e.g 1024x768 the size of my image may only be 800x600 thus the bitmap width would be 1024 yet I need to know the 600. My image size cannot not be the exact size of the bitmap supplied. If unclear I will try to better word this P.S I apologise in advance if this is a simple question and has been answered before but I couldn't think of any other words to put into a search ---------------------------------------------------------------------- wp · 2014-06-26 12:06 Code: [Select]  ThisDistance := (Image1.Width - Image1.Picture.Width) div 2; ---------------------------------------------------------------------- hello2hello · 2014-06-26 12:15 Hi Wp, For some reason when I tried that before it didn't work, worked perfectly this time thank you very much. ---------------------------------------------------------------------- hello2hello · 2014-06-26 15:53 I've been experimenting with the Image.picture.Width and have found that it does not change when the width of the picture changes? if I change the Image width manually in the IDE I would expect image.picture.width would change or is this accessing something else? My questions are Is the picture.width defined when the picture is loaded from file? When is the picture.width changed? ---------------------------------------------------------------------- wp · 2014-06-26 16:11 Sorry for confusing you: My former posting assumed a non-stretched image. If the image is stretched the Image1.DestRect contains the rectangle covered by the stretched image (I guess...). Therefore: Code: [Select]  ThisDistance := (Image1.Width - (Image1.DestRect.Right - Image1.DestRect.Left)) div 2; The Image.Picture.Width is the width of the image as it is written in the file (like bitmap.Width). The Image.Width, on the other hand, is the width of the control in the form. ---------------------------------------------------------------------- hello2hello · 2014-06-26 16:52 Wonderful, Exactly what I wanted Thank you very much wp