Re: Help with AfterScroll Event for Tadoquery
- From: Brian Bushay TeamB <BBushay@xxxxxxxxx>
- Date: Mon, 08 Aug 2005 21:55:57 -0500
>Hi Guys, I do not understand how to write a code for
>afterscroll event.
>Here is my problem : I run query, display values in the grid,
>then once I user hit on single record I want to show an image
>on the form ( MS Sql has one field declared as blob)
>I was able to do this by using drop components from Delphi ( ver 7). But when I try to do everything myself I am not able to see the image. Here is my code, any help but we great:
I don't have time to test your code but I will give you code I have tested
procedure TForm1.Table1AfterScroll(DataSet: TDataSet);
var
MS: TMemoryStream;
J1: TJPEGImage;
begin
J1 := TJPEGImage.Create;
MS := TMemoryStream.Create;
try
TBlobField(DataSet.Fieldbyname('myBlob')).SaveToStream(MS);
MS.Seek(0,soFromBeginning);
with J1 do begin
PixelFormat := jf24Bit;
Scale := jsFullSize;
Grayscale := False;
Performance := jpBestQuality;
ProgressiveDisplay := True;
ProgressiveEncoding := True;
LoadFromStream(MS);
end;
if MS.Size >0 then
Image1.Picture.Assign(J1)
else
Image1.Picture.Assign(nil);
finally
J1.Free;
MS.Free;
end;
end;
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- Follow-Ups:
- Re: Help with AfterScroll Event for Tadoquery
- From: chris
- Re: Help with AfterScroll Event for Tadoquery
- From: chris
- Re: Help with AfterScroll Event for Tadoquery
- References:
- Help with AfterScroll Event for Tadoquery
- From: chris
- Help with AfterScroll Event for Tadoquery
- Prev by Date: Help with AfterScroll Event for Tadoquery
- Next by Date: Re: tquery vs tadoquery master/detail deletions
- Previous by thread: Help with AfterScroll Event for Tadoquery
- Next by thread: Re: Help with AfterScroll Event for Tadoquery
- Index(es):
Relevant Pages
|