HI Lilly,
first you can take field in table As Container->then give “EDT” as Bitmap after
come to form Methods we Can write as below codes in methods…
in Class Declaration:
public class FormRun extends ObjectRun
{
Container image;
str imageFilePathName;
}
and then write a another Name as Upload Image Method in Methods
like:
void UploadImage()
{
FilenameFilter filter;
Bindata binData;
int _hwnd;
//haredCaptial SharedCaptial;
str extention, path, nameOfFile;
;
filter = [‘Image Files’,’.bmp;.jpg;.gif;.jpeg’];
binData = new BinData();
imageFilePathName = WinAPI::getOpenFileName(_hwnd,filter,’’, “@SYS53008”, ‘’,’’);
if (imageFilePathname && WinAPI::fileExists(imageFilePathName))
{
[path, nameOfFile, extention] = fileNameSplit(imageFilePathName);
if (extention == ‘.bmp’ ||
extention == ‘.jpg’ ||
extention == ‘.gif’ ||
extention == ‘.jpeg’)
{
binData.loadFile(imageFilePathName);
image = binData.getData();
element.ShowLogo();
ExmpleTable.FieldName = image;
}
else
{
throw error("@SYS89176");
}
}
}
then in the Design of Form ,you can take a button in that button method ucan write like this:
void clicked()
{
;
element.UploadImage();
}
try this it will work i hope…