ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 tiedbbitmap and blob is null....
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

eballinas

Mexico
37 Posts

Posted - Apr 20 2020 :  18:45:15  Show Profile  Reply
I attach a tiedbbitmap to an imageenview
I set autoload to true.
Everything seems right until I try to save the record: blob is null....
Can You help me?

mifoto:TIEDBBitmap;
AvancesFrm: TAvancesFrm;

implementation

{$R *.dfm}

uses DatosGeneralCod;

procedure TAvancesFrm.FormCreate(Sender: TObject);
begin
datosgeneral.abretabla(etapastb);
datosgeneral.abretabla(localidadestb);
DatosGeneral.abretabla(PROYECTOSTB);
DATOSGENERAL.abretabla(OBRASTB);
DATOSGENERAL.abretabla(AVANCESTB);
datosgeneral.abretabla(fotosdeavances);
mifoto := TIEDBBitmap.Create(FotosdeAvanceDs,'FOTO','');
MIFOTO.AutoLoad:=TRUE;
mirafotos.AutoToolbars:=
[ievViewing];
mirafotos.SetExternalBitmap( mifoto );

xequte

39053 Posts

Posted - Apr 20 2020 :  18:57:37  Show Profile  Reply
Hi

What method do you use to save the record?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

eballinas

Mexico
37 Posts

Posted - Apr 20 2020 :  19:01:42  Show Profile  Reply
Post....autocommit...
Go to Top of Page

eballinas

Mexico
37 Posts

Posted - Apr 21 2020 :  10:43:28  Show Profile  Reply
any further comment?
Go to Top of Page

xequte

39053 Posts

Posted - Apr 21 2020 :  18:05:35  Show Profile  Reply
So, is ImageEn saving the record, or your own code? Sorry, I don't see where ImageEn can be affecting this process.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

eballinas

Mexico
37 Posts

Posted - Apr 21 2020 :  18:58:17  Show Profile  Reply
Exactly...nothing seems wrong, but blob is null.
If you see, even after the insertion of the record, I can copy the exif image data to the record data, everything but the image...
What should I do...Help...

unit AvancesCod;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyieutils, iexBitmaps, hyiedefs,
  iesettings, iexLayers, iexRulers, ieview, iemview,iexdbbitmaps, FireDAC.Stan.Intf,
  FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
  FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
  Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, cxGraphics, cxControls,
  cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue,
  dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
  dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
  dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
  dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
  dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
  dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
  dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
  dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
  dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
  dxSkinOffice2019Colorful, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
  dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
  dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier,
  dxSkinsDefaultPainters, dxSkinValentine, dxSkinVisualStudio2013Blue,
  dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
  dxSkinWhiteprint, dxSkinXmas2008Blue, dxLayoutcxEditAdapters,
  dxLayoutContainer, cxContainer, cxEdit, cxStyles, cxCustomData, cxFilter,
  cxData, cxDataStorage, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
  cxDBData, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
  cxGridLevel, cxClasses, cxGridCustomView, cxGrid, cxTextEdit, cxMaskEdit,
  cxDropDownEdit, cxLookupEdit, cxDBLookupEdit, cxDBExtLookupComboBox,
  dxLayoutControl, imageenview, dxLayoutControlAdapters, vcl.wwspeedbutton,
  vcl.wwdbnavigator, Vcl.ExtCtrls, vcl.wwclearpanel, vcl.wwrcdpnl, ieopensavedlg;

type
  TAvancesFrm = class(TForm)
    ProyectosTb: TFDQuery;
    Obrastb: TFDQuery;
    AvancesTb: TFDQuery;
    ProyectosTbCLAVE: TFDAutoIncField;
    ProyectosTbNOMBRE: TWideStringField;
    ProyectosDs: TDataSource;
    ObrasDs: TDataSource;
    AvancesDs: TDataSource;
    ObrastbCLAVEOBRA: TFDAutoIncField;
    ObrastbNOMBRE: TWideStringField;
    ObrastbLATITUDGPS: TWideStringField;
    ObrastbLONGITUDGPS: TWideStringField;
    ObrastbLOCALIDAD: TWideStringField;
    ObrastbPROYECTO: TIntegerField;
    AvancesTbCLAVEDEAVANCE: TFDAutoIncField;
    AvancesTbCLAVEDELAOBRA: TIntegerField;
    AvancesTbCONCLUIDA: TBooleanField;
    AvancesTbTIPODEAVANCE: TIntegerField;
    dxLayoutControl1Group_Root: TdxLayoutGroup;
    dxLayoutControl1: TdxLayoutControl;
    cxExtLookupComboBox1: TcxExtLookupComboBox;
    dxLayoutItem1: TdxLayoutItem;
    dxLayoutGroup1: TdxLayoutGroup;
    dxLayoutSplitterItem1: TdxLayoutSplitterItem;
    cxGrid2DBTableView1: TcxGridDBTableView;
    cxGrid2Level1: TcxGridLevel;
    cxGrid2: TcxGrid;
    dxLayoutItem3: TdxLayoutItem;
    cxGridViewRepository1: TcxGridViewRepository;
    cxExtLookupComboBox2: TcxExtLookupComboBox;
    dxLayoutItem5: TdxLayoutItem;
    dxLayoutAutoCreatedGroup2: TdxLayoutAutoCreatedGroup;
    VeProyectos: TcxGridDBTableView;
    VeObras: TcxGridDBTableView;
    cxGrid2DBTableView1CLAVEDEAVANCE: TcxGridDBColumn;
    cxGrid2DBTableView1CLAVEDELAOBRA: TcxGridDBColumn;
    cxGrid2DBTableView1CONCLUIDA: TcxGridDBColumn;
    cxGrid2DBTableView1TIPODEAVANCE: TcxGridDBColumn;
    VeProyectosCLAVE: TcxGridDBColumn;
    VeProyectosNOMBRE: TcxGridDBColumn;
    VeObrasCLAVEOBRA: TcxGridDBColumn;
    VeObrasNOMBRE: TcxGridDBColumn;
    VeObrasLATITUDGPS: TcxGridDBColumn;
    VeObrasLONGITUDGPS: TcxGridDBColumn;
    VeObrasLOCALIDAD: TcxGridDBColumn;
    VeObrasPROYECTO: TcxGridDBColumn;
    LocalidadesTb: TFDQuery;
    LocalidadesDs: TDataSource;
    VeLocalidades: TcxGridDBTableView;
    LocalidadesTbCLAVE: TWideStringField;
    LocalidadesTbCONCATENATION: TWideStringField;
    VeLocalidadesCONCATENATION: TcxGridDBColumn;
    EtapasDs: TDataSource;
    EtapasTb: TFDQuery;
    EtapasTbCLAVEETAPA: TFDAutoIncField;
    EtapasTbNOMBREDEETAPA: TWideStringField;
    EtapasTbCLAVEPROYECTO: TIntegerField;
    VeEtapas: TcxGridDBTableView;
    VeEtapasCLAVEETAPA: TcxGridDBColumn;
    VeEtapasNOMBREDEETAPA: TcxGridDBColumn;
    VeEtapasCLAVEPROYECTO: TcxGridDBColumn;
    FotosdeAvances: TFDQuery;
    FotosdeAvanceDs: TDataSource;
    FotosdeAvancesCLAVE: TFDAutoIncField;
    FotosdeAvancesCLAVEDEAVANCE: TIntegerField;
    FotosdeAvancesFOTO: TBlobField;
    FotosdeAvancesFECHADEALTAALSISTEMA: TDateField;
    FotosdeAvancesFECHADETOMADEFOTO: TDateField;
    FotosdeAvancesGPSLATITUDDECIMAL: TWideStringField;
    FotosdeAvancesGPSLONGITUDDECIMAL: TWideStringField;
    wwRecordViewPanel1: TwwRecordViewPanel;
    dxLayoutItem2: TdxLayoutItem;
    dxLayoutGroup2: TdxLayoutGroup;
    wwDBNavigator1: TwwDBNavigator;
    dxLayoutItem6: TdxLayoutItem;
    wwDBNavigator1First: TwwNavButton;
    wwDBNavigator1PriorPage: TwwNavButton;
    wwDBNavigator1Prior: TwwNavButton;
    wwDBNavigator1Next: TwwNavButton;
    wwDBNavigator1NextPage: TwwNavButton;
    wwDBNavigator1Last: TwwNavButton;
    wwDBNavigator1Insert: TwwNavButton;
    wwDBNavigator1Delete: TwwNavButton;
    wwDBNavigator1Edit: TwwNavButton;
    wwDBNavigator1Post: TwwNavButton;
    wwDBNavigator1Cancel: TwwNavButton;
    wwDBNavigator1Refresh: TwwNavButton;
    wwDBNavigator1SaveBookmark: TwwNavButton;
    wwDBNavigator1RestoreBookmark: TwwNavButton;
    Abreimagen: TOpenImageEnDialog;
    Mirafotos: TImageEnView;
    dxLayoutItem4: TdxLayoutItem;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FotosdeAvancesAfterInsert(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
     mifoto:TIEDBBitmap;
  AvancesFrm: TAvancesFrm;

implementation

{$R *.dfm}

uses DatosGeneralCod;

procedure TAvancesFrm.FormCreate(Sender: TObject);
begin
      datosgeneral.abretabla(etapastb);
      datosgeneral.abretabla(localidadestb);
     DatosGeneral.abretabla(PROYECTOSTB);
     DATOSGENERAL.abretabla(OBRASTB);
     DATOSGENERAL.abretabla(AVANCESTB);
     datosgeneral.abretabla(fotosdeavances);
     mifoto := TIEDBBitmap.Create(FotosdeAvanceDs,'FOTO','');
     MIFOTO.AutoLoad:=TRUE;
     mirafotos.AutoToolbars:=
          [ievViewing];
     mirafotos.SetExternalBitmap( mifoto );
end;

procedure TAvancesFrm.FormDestroy(Sender: TObject);
begin
     freeandnil(mifoto);
end;

procedure TAvancesFrm.FotosdeAvancesAfterInsert(DataSet: TDataSet);
begin
     if abreimagen.Execute then
     begin
          mirafotos.IO.LoadFromFile(abreimagen.FileNameW);
          with mirafotos.IO.Params do
          if exif_hasexifdata then
          begin
               FotosdeAvancesFECHADETOMADEFOTO.Value:=
                    EXIF_DateTime2;
               FotosdeAvancesGPSLATITUDDECIMAL.Value:=
                    EXIF_GPSLatitude.ToString;
               FotosdeAvancesGPSLONGITUDDECIMAL.Value:=
                    exif_gpslongitude.ToString;
          end;

          end
          else
               fotosdeavances.Cancel;
end;

end.
Go to Top of Page

xequte

39053 Posts

Posted - Apr 21 2020 :  22:48:54  Show Profile  Reply
Hi

You should not be using:

mirafotos.IO.LoadFromFile(abreimagen.FileNameW);

If mirafotos is connected to a database.

Other than that, I cannot see anything wrong. Can you reproduce in our TIEDBBitmap demo?



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: