Bertifox Posted June 1, 2017 Share Posted June 1, 2017 Hola foristas, necesito abrir un dialogo para cargar una imagen a un TUniDBImage, utilizo TOpenPictureDialog pero este no muestra el dialogo, no encuentro un componente similar de UniGUI, Existe alguna alternativa? Saludos Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 1, 2017 Share Posted June 1, 2017 Hi, Which edition and build are you using ?! You can look at our demo example: \FMSoft\Framework\uniGUI\Demos\Desktop\FileUpload - Filter Best regards, Quote Link to comment Share on other sites More sharing options...
Bertifox Posted June 1, 2017 Author Share Posted June 1, 2017 Hola Delphi Developer, uso la versión uni-1.0.0.1384 revisé el ejemplo y funciona muy bien, se muestra la imagen en UniDBImagen pero no graba al campo Foto. procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); begin UniDBImageProp.Picture.LoadFromFile(AStream.FileName); UniLabelImagenProp.Caption:='Foto : '+UniFileUpload1.FileName; end; Para tratar de grabar utilizo: procedure TMainForm.UniBitBtnCargaPropClick(Sender: TObject); begin If UniFileUpload1.Execute Then Begin UniMainModule.UniQueryPropietarios.Post; UniMainModule.UniQueryPropietarios.Edit; End; end; Gracias... Quote Link to comment Share on other sites More sharing options...
ricardolb Posted June 1, 2017 Share Posted June 1, 2017 You should post to the database only after the UniFileUpload1Completed Hola Delphi Developer, uso la versión uni-1.0.0.1384 revisé el ejemplo y funciona muy bien, se muestra la imagen en UniDBImagen pero no graba al campo Foto. procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); begin UniDBImageProp.Picture.LoadFromFile(AStream.FileName); UniLabelImagenProp.Caption:='Foto : '+UniFileUpload1.FileName; end; Para tratar de grabar utilizo: procedure TMainForm.UniBitBtnCargaPropClick(Sender: TObject); begin If UniFileUpload1.Execute Then Begin UniMainModule.UniQueryPropietarios.Post; UniMainModule.UniQueryPropietarios.Edit; End; end; Gracias... Quote Link to comment Share on other sites More sharing options...
Bertifox Posted June 2, 2017 Author Share Posted June 2, 2017 Gracias por la ayuda recibida, La solución es utilizar los componentes TUniFileUpload y TUniImage, En el evento UniFileUpload1Completed, se carga la foto a UniImage1 y luego se asigna al campo Foto de la tabla o query. AStream: TFileStream); begin UniImage1.Picture.LoadFromFile(AStream.FileName); UniLabelImagenProp.Caption:='Foto : '+UniFileUpload1.FileName; UniMainModule.UniQueryPropietarios.Edit; UniMainModule.UniQueryPropietarios.FieldByName('Foto').Assign(UniImage1.Picture); UniMainModule.UniQueryPropietarios.Post; end; Saludos Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.