c# - Epicor10-Image.Save method -
i trying build customized window in epicor 10. have added picturebox , try open picture(bmp) file , button save somewhere else. problem in customization tools dialog epicor 10, write code when compile keep getting error:
error: cs1061 - line 258 (953) - 'object' not contain definition 'save' , no extension method 'save' accepting first argument of type 'object' found (are missing using directive or assembly reference?) ** compile failed. **
now, when have copied code, , re-created windows form app visual studio 2012, works fine, no errors on compilation @ all.
the code quite simple:
private void epibuttonc6_click(object sender, system.eventargs args) { var fd = new savefiledialog(); fd.filter = "bmp(*.bmp)|*.bmp;| jpg(*jpg)|*.jpg;| png(*png)|*.png"; fd.addextension = true; if (fd.showdialog() == system.windows.forms.dialogresult.ok) { switch (path.getextension(fd.filename).toupper()) { case ".bmp": epipictureboxc1.image.save(fd.filename, system.drawing.imaging.imageformat.bmp); break; case ".jpg": epipictureboxc1.image.save(fd.filename, system.drawing.imaging.imageformat.jpeg); break; case ".png": epipictureboxc1.image.save(fd.filename, system.drawing.imaging.imageformat.png); break; default: break; } } }
epipicturebox not derived system.windows.forms.picturebox. derived infragistics.win.ultrawineditors.ultrapicturebox.
the image property on system.windows.forms.picturebox of type system.drawing.image image property of infragistics.win.ultrawineditors.ultrapicturebox system.object. why things not behaving expect them to.
i able mockup working using following work long sure whatever assigned proptery of epipictureboxc1.image indeed going able cast system.drawing.image
switch (path.getextension(fd.filename).toupper()) { case ".bmp": ((system.drawing.image)epipictureboxc1.image).save(fd.filename, system.drawing.imaging.imageformat.bmp); break; case ".jpg": ((system.drawing.image)epipictureboxc1.image).save(fd.filename, system.drawing.imaging.imageformat.jpeg); break; case ".png": ((system.drawing.image)epipictureboxc1.image).save(fd.filename, system.drawing.imaging.imageformat.png); break; default: break; }
Comments
Post a Comment