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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 tiedbbitmap and blob is null....

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
eballinas Posted - Apr 20 2020 : 18:45:15
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 );
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 21 2020 : 22:48:54
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
eballinas Posted - Apr 21 2020 : 18:58:17
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.
xequte Posted - Apr 21 2020 : 18:05:35
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
eballinas Posted - Apr 21 2020 : 10:43:28
any further comment?
eballinas Posted - Apr 20 2020 : 19:01:42
Post....autocommit...
xequte Posted - Apr 20 2020 : 18:57:37
Hi

What method do you use to save the record?

Nigel
Xequte Software
www.imageen.com