No Graphics lazarus / 31-LCL ---------------------------------------------------------------------- James_Parsons · 2014-01-24 17:03 I was trying to do a screenshot with the language as found in http://wiki.freepascal.org/Developing_with_Graphics, however, there is no graphics library. I attempt to compile Code: [Select]program Screen; uses   Graphics,   LCLIntf,   LCLType; var   Screen:      TBitmap;   ScreenDC:    HDC; begin   Screen        := TBitmap.Create;   ScreenDC      := GetDC(0);   Bitmap.LoadFromDevice(ScreenDC);   ReleaseDC(0, ScreenDC); end.                    and get Code: [Select]Options changed, recompiling clean with -B project1.lpr(4,3) Fatal: Can not find unit Graphics used by Screen. Check if package LCLBase is in the dependencies of the project inspector. Is this code outdated?? ---------------------------------------------------------------------- taazz · 2014-01-24 17:19 No it should work, I used the same piece of code just 10 minutes ago on a windows machine. IS the lclbase package in your required list? open "project\project inspector" menu and chekc if lcl is in the "Required packages" list. Did you create a new application or a new program/simple program? ---------------------------------------------------------------------- James_Parsons · 2014-01-24 17:27 I did a simple program. I didnt nessecarily need any gui to go with the program. ---------------------------------------------------------------------- taazz · 2014-01-24 17:33 A screenshot requires all the plumping and linking against the GUI widget set of your OS it is the only way to talk with it and take a screen shot from its desktop. Your application might not have a GUI but that does not erase the need to use it. ---------------------------------------------------------------------- Leledumbo · 2014-01-25 02:35 Graphics is part of LCLBase so you MUST have it as your project dependency. LCLBase doesn't contain GUI related stuffs that links to the backend, so it can be used without actually using any GUI. ---------------------------------------------------------------------- kirchfritz · 2014-01-25 07:42 Hi, two additional annotations: a) Do not use a variable named "Screen" while program name is "Screen" too! b) Replace the codeline Code: [Select]Bitmap.LoadFromDevice(ScreenDC);  with Code: [Select]Screen.LoadFromDevice(ScreenDC); ---------------------------------------------------------------------- Rails · 2014-01-25 11:36 Also, screen is a global variable of type TScreen exported by the Forms unit, used by most applications, which is another reason to avoid using it for other purposes.