static void
InsertingimagefromFolder(Args _args)
{
BinData
binData = new BinData();
ImageStore table;
dialog d;
Dialog dialog
= new dialog();
dialogField
dialogFilename;
//COM wordDocuments;
FileName fileName;
container imageContainer;
str imageFilePathName;
d = new dialog();
d.caption("select a Image file");
dialogFilename = d.addField(extendedTypeStr(FilenameOpen),"File Name");//add
a field where you select your file in a specific path
d.run();//execute dialog
if(d.closedOk())
{
filename = dialogFileName.value();//return
path file value
}
if(!fileName)
{
checkFailed("please select image ");
}
else
{
imageFilePathName=filename;
if ( WinAPI::fileExists(imageFilePathName))
{
binData.loadFile(imageFilePathName);
imageContainer = binData.getData();
//table.Image = _Party.RecId;
table.MediumSize = imageContainer;
table.insert();
}
}
}
No comments:
Post a Comment