[SOLVED] TImage is being clipped. lazarus / 39-Graphics ---------------------------------------------------------------------- Kingga · 2019-01-19 21:13 I'm new to both Pascal and Lazarus and I need it for a library called php-gui. I'm trying to add an image class to it and I'm currently doing it by using PHP Imagick and then rendering each pixel to a canvas. This is quite slow for larger images so I decided to jump into the Pascal and loaded the image like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (objArray[objId] as TImage).Picture.LoadFromFile(jData.FindPath('param s[2][0]').AsString);After compiling and setting up the class to use this I get an image but it has been cut off. See screenshot: https://gyazo.com/9b56faf001b5a34c00de1c2dea125d4a I also use something which has already been built in php-gui which is defined in Pascal like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i (objArray[objId] as TImage).Picture.Bitmap.SetSize(jData.FindPath('par ams[2][0]').AsInteger,jData.FindPath('params[2][1]').AsInteger);before calling the load file function. Would anyone know what was causing this and how I can fix it? ---------------------------------------------------------------------- circular · 2019-01-19 21:42 Hmm what about TImage.Width and .Height ? ---------------------------------------------------------------------- Kingga · 2019-01-19 22:20 It's always the simple things. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i else if messageMethodName = 'image.setSize' thenbegin  (objArray[objId] as TImage).Width := jData.FindPath('params[2][0]').AsInteger;  (objArray[objId] as TImage).Height := jData.FindPath('params[2][1]').AsInteger;endelse if messageMethodName = 'image.loadFromFile' thenbegin  (objArray[objId] as TImage).Picture. LoadFromFile(jData.FindPath('params[2][0]').AsString);end  Thanks for your help.