Created
October 26, 2022 05:31
-
-
Save MySohoWiki/c944cb479365625e8e73e70fd012f70e to your computer and use it in GitHub Desktop.
Form with image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Συναλλαγές, εργασία: "show φορμα" , στη φόρμα πατώντας κλικ εμφανίζει την εικόνα τους είδους (αν έχει) | |
var | |
f: Tform; | |
cImage: TImage; | |
procedure DoClick2; | |
begin | |
f.visible:= true; | |
end; | |
procedure cImage_OnClick; | |
var | |
ds: TclientDataSet; | |
begin | |
if itemtrnds['iteDescr'].isnull then | |
exit; | |
ds:= prg.QueryDataSet(nil, 'exec usp_SelectImage :1', itemtrnds['itemID'].value); | |
try | |
TBlobField(ds.fields[1]).SaveToFile('d:\test1.png'); | |
cImage.Picture.loadfromfile('d:\test1.png'); | |
finally | |
ds.free; | |
end; | |
f.caption:= itemtrnds['iteDescr'].asstring; | |
end; | |
procedure BeforeLoad; | |
begin | |
showmessage('Hi'); | |
end; | |
procedure init; | |
begin | |
frm.addinditask('show φορμα', @DoClick2, nil, true); | |
end; | |
Begin | |
bol.oninitialize:= @init; | |
f:= Tform.create(frm); | |
f.FormStyle:= fsStayOnTop; | |
f.SetBounds(800,200,200,200); | |
f.borderStyle:= bsSizeToolWin; | |
f.caption:= 'photo'; | |
cImage:= TImage.create(f); | |
cImage.align:= alclient; | |
cImage.parent:= f; | |
cImage.OnClick:= @cImage_OnClick; | |
End. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment