2022年4月13日 星期三

delphi - How to display BLOB Image from database in the TAdvStringGrid with the help of DataSet https://vigges.net/qa/?qa=1132506/

 
CreateBlobStream Picture LoadFromStream

delphi - How to display BLOB Image from database in the TAdvStringGrid with the help of DataSet
https://vigges.net/qa/?qa=1132506/

CreateBlobStream is creating a TStream object, not a TMemoryStream.
Since you do not want to write the JPG to the database you should use bmRead instead of bmReadWrite.
I am not used to SQLite, but you will have to make sure that you are using a suitable binary datetype (BLOB).

  JPG := TJpegImage.Create;
  Picture:= TPicture.Create;
  try
    st := results.CreateBlobStream(TBlobField(results.FieldByName('image')), bmRead);
    try
      JPG.LoadFromStream(st);
      Picture.Assign(JPG);
      sg.AddPicture(i,j,Picture,True,ShrinkWithAspectRatio,0,haLeft,vaTop);
    finally
      st.Free;
    end;
  finally
    JPG.Free;
    Picture.Free;
  end;

To ensure that the stored image is really a JPG you should write the JPG for testing with something like:

var
  ms: TMemoryStream;
begin
  ads.Open;
  ads.Append;
  ms := TMemoryStream.Create;
  try
    Image1.Picture.Graphic.SaveToStream(ms); // make sure having loaded a JPG
    ms.Position := 0;
    TBlobField(ads.FieldByName('image')).LoadFromStream(ms);
  finally
    ms.Free;
  end;
  ads.Post;
end;
https://kifmesoft.wordpress.com/2006/06/09/memorystream-untuk-menampung-blob-field-image-picture/
 https://codeverge.com/embarcadero.delphi.database/saving-a-jpg-in-a-graphicsfield/1067238
 https://stackoverflow.com/questions/40357324/trying-to-save-a-bmp-from-pc-to-a-database-blob-field
https://www.chestysoft.com/ximage/access1.asp 
https://forum.lazarus.freepascal.org/index.php?topic=43499.0 

8051 IAR Keil Mikro SDCC

 8051  IAR Keil Mikro SDCC

 https://turbo51.com/

 http://www.openrtos.net/RTOS_ports.html

 https://www.intorobotics.com/8051-microcontroller-programming-tutorials-simulators-compilers-and-programmers/

 

8051 assembly machine code  The following table lists the 8051 instructions by HEX code. 


translate pascal 8051 Assembler Translation
http://www.8051projects.info/resources/8051-assemblers-and-ides.22/
https://stackoverflow.com/questions/15204459/is-there-any-8051-assembly-language-to-c-code-converter
https://www.microapl.com/asm2c/sample8051.html

Relogix™ Sample Translation (8051)


This sample translation uses the source code of a software-implemented I2C driver for the 80C51 based microcontroller.


http://bit.kuas.edu.tw/~8051/

8051 Development Tools