Draw Directly on TBitmap lazarus / 61-Beginners ---------------------------------------------------------------------- trayres · 2016-03-28 05:49 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 var bmp: TBitmap; begin bmp := TBitmap.Create;bmp.SetSize(600,600); <- This is causing a segfault{Draw some stuff}end.  In file lclintf.inc at line 177: Result:=WidgetSet.RawImage_QueryDescription(AFlags,ADesc); This looks a lot like example code from Delphi; I think something isn't being initialized correctly? I started from a simple console project, and added LCL as a required package to get the Graphics module. Any thoughts all? Thanks! ---------------------------------------------------------------------- JZS · 2016-03-28 09:28 With Lazarus 1.6 on Windows this piece of code compiles/runs successfully. Probably you need to mention the version you are using, and on which platform! ---------------------------------------------------------------------- Leledumbo · 2016-03-28 11:35 Quote from: trayres on March 28, 2016, 07:49:22 amThis looks a lot like example code from Delphi; I think something isn't being initialized correctly? I started from a simple console project, and added LCL as a required package to get the Graphics module. Nah, Delphi doesn't have widgetset concept. The missing thing is Interfaces unit, since the code queries underlying widgetset which won't exist if you omit Interfaces from uses clause. ---------------------------------------------------------------------- Handoko · 2016-03-28 11:54 It works on my Lazarus installation. Just as Leledumbo said, Lazarus is not Delphi. You better start your new project by clicking: menu > File > New > Application. By doing that, it will automatically put necessaries units in the uses clause. Or you can simply download my sample project for testing ---------------------------------------------------------------------- trayres · 2016-04-01 16:30 Quote from: Leledumbo on March 28, 2016, 01:35:01 pmQuote from: trayres on March 28, 2016, 07:49:22 amThis looks a lot like example code from Delphi; I think something isn't being initialized correctly? I started from a simple console project, and added LCL as a required package to get the Graphics module. Nah, Delphi doesn't have widgetset concept. The missing thing is Interfaces unit, since the code queries underlying widgetset which won't exist if you omit Interfaces from uses clause. This was exactly the problem. Thank you! Adding the Interfaces unit solved it, and now I know how to get an LCL program running without going through the wizard (so I have a better idea of what's going on). Much appreciated!