Skip to main content

Posts

Showing posts with the label Image handling in Ax

Code for uploading image file in table using MSD axapta

Code for uploading image file in table using x++ code FilenameFilter filter = ['Image Files', '*.bmp;*.jpg;*.gif;*.jpeg']; BinData binData = new BinData(); str extest, filepath, nameofFile; ; super(); imageFilePathName = WinAPI::getOpenFileName(element.hWnd(),filter,'',"abc"); if(imageFilePathName && WinAPI::fileExists(imageFilePathName)) { [filepath, nameOfFile,extest] = fileNameSplit(imageFilePathName); if(extest== '.bmp' || extest== '.jpg' || extest== '.gif' || extest== '.jpeg') { bindata.loadFile(imageFilePathName); imageContainer = bindata.getData(); TestTable.Image =imageContainer; TestTable.write(); } else { throw error("Error in uploading"); } }

Upload an image in a form window control in MSD axapta

Upload an image in a form window control str filename; FileNameFilter filter = ['JPG files','*.jpg']; Bindata binData; Image signatureImage = new Image(); super(); filename = Winapi::getOpenFileName(element.hWnd(), filter, '', "Upload your image", '', ''); binData = new BinData(); if (binData.loadFile(filename)) { signatureImage = binData.getData(); FormWindowCOntrol.image(signatureImage); FormWindowCOntrol.widthValue(signatureImage.width()); FormWindowCOntrol.heightValue(signatureImage.height()); element.resetSize(); element.unLock(); }

How to Load image using axapta x++ code

void loadImage() { Image img; CompanyImage companyImage; ; companyImage = CompanyImage::find(InventTable.dataAreaId,InventTable.TableId,InventTable.RecId); if (companyImage.Image) { img = new Image(); img.setData(companyImage.Image); ItemImage.image(img); } else { ItemImage.image(null); } }

set image using axapta

Image img; CompanyImage companyImage; ; companyImage = CompanyImage::find( InventTable.dataAreaId, InventTable.TableId, InventTable.RecId); if (companyImage.Image) { img = new Image(); img.setData(companyImage.Image); ItemImage.image(img); } else { ItemImage.image(null); }