My application is greydout lazarus / 16-Databases ---------------------------------------------------------------------- jeanchristophe · 2014-08-22 15:07 Hello I have a little database application, where I have to edit some rows, choose a picture from a openpicture dialog and then save the filename in the database (sqlite) My application gets grey, when I open the open picture dialog. when I close it, the form should get back to its own colour, but it stills get gray. Can you please tell me, how I can avoid that? Best Regards Jean-Christophe ---------------------------------------------------------------------- Eclipticon · 2014-08-22 15:33 Hi, could you post some details, like what operating system you are using, and the code you use to open this dialog? ---------------------------------------------------------------------- jeanchristophe · 2014-08-22 15:56 Thank you for your answer  Eclipticon! I run it on Mageia 4 (Linux - rpm based) i386 This is the last Lazarus version: 1.2.4 Here is the code: Code: [Select]procedure TForm1.FormCreate(Sender: TObject); begin   SQLite3Connection1.DatabaseName:= '/home/jean- christophe/Desktop/Lazarus/database/stamps.sqlite';   If SQLite3Connection1.Connected= false then SQLite3Connection1.Connected:= true;   SQLTransaction1.DataBase:= SQLite3Connection1;   If SQLTransaction1.Active= false then SQLTransaction1.Active:=True;   SQLQuery1.DataBase:= SQLite3Connection1;   SQLQuery1.Transaction:= SQLTransaction1;   SQLQuery1.PacketRecords:= -1;   SQLQuery1.SQL.Add   ('select * from yverttablefrim where Land = "France" and BilledetNogle is NULL order by Nummer asc;');   If SQLQuery1.Active = false then SQLQuery1.Active:= true;   DataSource1.DataSet:= SQLQuery1;   If image1.Proportional = false then image1.Proportional := true;   If image1.Center= false then image1.Center:= true; end; procedure TForm1.SQLQuery1AfterPost(DataSet: TDataSet); begin   SQLQuery1.ApplyUpdates;   SQLTransaction1.CommitRetaining; end; procedure TForm1.B_CloseClick(Sender: TObject); begin   If SQLite3Connection1.Connected= true then SQLite3Connection1.Connected:= false;   If SQLTransaction1.Active= true then SQLTransaction1.Active:= false;   If SQLQuery1.Active = true then SQLQuery1.Active:= false;   Application.Terminate; end; procedure TForm1.DBGrid1CellClick(Column: TColumn); begin   if not(DBGrid1.DataSource.DataSet.Fields[1].Value = NULL) then   Image1.Picture.LoadFromFile(DBGrid1.DataSource.DataSet.Fields[1].Val ue)   else   Image1.Picture.Clear; end; procedure TForm1.DBNavigator1Click(Sender: TObject; Button: TDBNavButtonType); begin   if not(DBGrid1.DataSource.DataSet.Fields[1].Value = NULL) then   Image1.Picture.LoadFromFile(DBGrid1.DataSource.DataSet.Fields[1].Val ue)   else   Image1.Picture.Clear; end; procedure TForm1.B_Choose_FileClick(Sender: TObject); var   filename: String;   begin     if OpenPictureDialog1.Execute then     begin       filename := OpenPictureDialog1.Filename;       Image1.Picture.LoadFromFile(filename);       filename  := StringReplace(filename, '***/Lazarus', '..',[rfReplaceAll, rfIgnoreCase]);       DBedit2.Text:= filename;     end;   end; end.                        Best Regards Jean-Christophe ---------------------------------------------------------------------- Never · 2014-08-22 18:01 may i ask the size of the image you are making your tests? ---------------------------------------------------------------------- jeanchristophe · 2014-08-22 18:20 Thank you for your answer Never The jpg is about 50k, about 500 x 300 pix. One another thing is that I can't see the imagepreview in the OpenPictureDialog. Is it normal? Best Regards Jean-Christophe ---------------------------------------------------------------------- Never · 2014-08-22 18:32 looks like your image for some reason is stuck on loading a)check that your image component supports the loadding of your image type http://wiki.freepascal.org/Developing_with_Graphics b)try to double check your paths use full hardcode  paths at first ,    be sure all is working fine and then proceed with automation also chek if in your paths are included not standar latin chars ---------------------------------------------------------------------- jeanchristophe · 2014-08-22 19:39 I am going to try that Never. But when I run one another little application I made, I can load the filename into an TImage component without problems. It is just with the TOpenPictureDialog, I experience problems/challenges. I didn't try on windows yet. Best Regards Jean-Christophe