Images

Hi all

I have a product form where list of products is saved and i need to create a button calles Images . wen that button is clicked that particular Image of the product has to be displayed

Thanks & Regards

Manjusha.D

FilenameFilter filter = [‘Image Files’,’.bmp;.jpg;.gif;.jpeg’];

BinData binData = new BinData();

str extention, path, nameOfFile;

Container ImageContainer;

super();

imageFilePathName = WinAPI::getOpenFileName(element.hWnd(),filter,’’, “anytext”, ‘’,’’);

if (imageFilePathname && WinAPI::fileExists(imageFilePathName))

{

[path, nameOfFile, extention] = fileNameSplit(imageFilePathName);

if (extention == ‘.bmp’ ||

extention == ‘.jpg’ ||

extention == ‘.gif’ ||

extention == ‘.jpeg’)

{

binData.loadFile(imageFilePathName);

imageContainer = binData.getData();

element.showLogo();

element.insert();

}

}

set the table column datatype as Bitmap

insert the data (this codin imageContainer )

““wen that button is clicked that particular Image of the product has to be displayed””

display the image:

if (ImageContainer)

{

logoImage = new Image();

logoImage.setData(ImageContainer);

FrnImage.image(logoImage);

}

element.resetSize();

}

FrnImage - ImageField.

ImageContainer - value from table.

Hi Manjusha,

You need to follow 4 simple steps to achieve this task .Go through the steps

Step1: Give Menuitem of CompanyImage in your Product Form.

**Step2:**Add Bitmap Window Ctrl in to ur Form

**Step3:**Write a Image method in Form Level as Follows;

void image()
{
Image img;
CompanyImage ci;
;
ci = CompanyImage::find(.dataAreaId, .TableId, .RecId);
if(ci.Image)
{
img = new Image();
img.setData(ci.Image);
.image(img);
.heightValue(150);
.widthValue(150);
}
else
{

.image(null);
}

}

Step4:Call this Image method in Form Level Activate method after Super as Follows

element.Image();

By doing this u can get the Image for Particular Product

Have you tried with the Document Handling Functionality???