[solved]canvas painting not work on qt lazarus / 39-Graphics ---------------------------------------------------------------------- ali-libre · 2016-10-10 14:05 i'm try paintint on form using qt but nothing happend it seem's canvas have problem on qt... ---------------------------------------------------------------------- wp · 2016-10-10 14:18 Quote from: ali-libre on October 10, 2016, 04:05:06 pmit seem's canvas have problem on qt... Certainly not. What are you doing? This code is working in Linux Mint/qt: 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 unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs; type   { TForm1 }   TForm1 = class(TForm)    procedure FormPaint(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.FormPaint(Sender: TObject);begin  Canvas.Brush.Color := clRed;  Canvas.Ellipse(10, 10, Width-10, Height-10);end; end. ---------------------------------------------------------------------- ali-libre · 2016-10-10 14:23 no.  not worked... what goes wrong...? ---------------------------------------------------------------------- lainz · 2016-10-10 14:27 Quote from: ali-libre on October 10, 2016, 04:23:37 pmno.  not worked... what goes wrong...? You clicked in the Object Inspector, then in 'Events' tab, and then click on OnPaint event to create the event? ---------------------------------------------------------------------- ali-libre · 2016-10-10 14:45 no means not painted... it compile and run without any error or fault but not red form ---------------------------------------------------------------------- lainz · 2016-10-10 14:59 Quote from: ali-libre on October 10, 2016, 04:45:46 pmno means not painted... it compile and run without any error or fault but not red form I know. But you didn't answer my question. ---------------------------------------------------------------------- wp · 2016-10-10 15:23 In the attachment you find the full project of which I had shown only the pas file. Unzip, compile and run. It must work. Select the form in the Object inspector, select the second page "Events". See the "FormPaint" next to "OnPaint"? This means that the OnPaint event of the form has been assigned to the code in the procedure "FormCreate". To create such an assignment in case of a new project you select the line with "OnPaint" and click on the '...' button (or double-click on the white space). This opens the code editor and inserts an empty event method. Now you can add the drawing code that you want. ---------------------------------------------------------------------- lainz · 2016-10-10 15:37 ali-libre You get where is the object inspector? I asked you before but you didn't answer what language you speak, maybe if your lazarus isn't in english due to translations you can't get what we're talking here. Is just my idea, I don't know. Try to change lazarus language to english, I did that to get what everyone else is talking here. Then when you know it, you can change it back to your native language. I know english can be hard for non native speakers, like me (I speak and write in spanish), but you need to get it else is difficult to get help here and in general in programming, everything is in english. ---------------------------------------------------------------------- ali-libre · 2016-10-10 15:45 i'm sorry i have to do something and it become late yes you right.. canvas worked truly i was edited bgrabitmap mounth ago to work on qt but it wasn't now restore bgrabitmap canvas work without any problem... i must to listen than speak thank's