Forum > Databases

Load image from file to database and show later ?

<< < (2/2)

rretamar:
I need a sample with dbimage component.  :(

GetMem:

--- Quote ---I need a sample with dbimage component.  :(

--- End quote ---
Why? Drop another TImage to your form, then use the AfterScroll event of the query:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.SQLQuery1AfterScroll(DataSet: TDataSet); var   St: TStream; begin   if SQLQuery1.FieldByName('PICTURE').IsNull then   begin     Image2.Picture.Clear;     Exit;   end;    St := SQLQuery1.CreateBlobStream(SQLQuery1.FieldByName('PICTURE'), bmRead);    try     Image2.Picture.LoadFromStream(St);   finally     St.Free;   end;end; 

mariodosreis:
Jesus it seams i went back to delphi2/3/5 +/-. Is there some one available to convert  from Delphi to Lazarus. I tryed but no success
Wel i' using Lazarus since yesterday (i'm very far from an experimented Lazarus guy all is kind of new to me so similar and so diferent from delphi!?!?!
{
 TEDBImage 1.5 (Enhaced TDBImage):
  by Sebastián Mayorá - Argentina - DelphiHelper@yahoo.com.ar
 Please read EDBImage.txt or readme.txt for more information
 New in this release:
  Property Stretch Droped.
  Property ShinkToFit added, if true and the graphic is bigger than the component,
      then scale the image to fit into the component (See Rescale method).
  Property ZoomToFit added, if true  and the graphic is smaller than the component,
      then scale the image to fit into the component (See Rescale method).
  (Thanks to Liliana Troncoso)
  Native Support for
   .ico .jpg .jpeg .wmf .emf .bmp and now .GIF and .TIFF .TIF (Thanks to Mike Lischke for GraphicEx).
}
I' use it from seculum seculorum since Delphi 3 till XE7 i beleave. Now i'm trying Lazarus but i'm somo kind of very desapointed!
Never the less w'll try a litle more

Handoko:
Hello mariodosreis,
Welcome to the forum.

Although Lazarus tries to be compatible with Delphi but it is not Delphi.
https://wiki.lazarus.freepascal.org/Lazarus_For_Delphi_Users

In the Graphics section in the link below, you can find many simple codes for manipulating pictures:
https://wiki.freepascal.org/Portal:HowTo_Demos#Graphics

Navigation

[0] Message Index

[*] Previous page

Go to full version