Jump to content

Equivalente UniGUI de TOpenPictureDialog


Bertifox

Recommended Posts

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...