Use of getContents with Images

Hello All, Can anyone explain to me ( preferably with a code example ) how I can load the contents of an Image object into a BufferedImage in Java in a Java Action. I tried the following which did not work. Is the use of getContents() correct here ? .....  ByteArrayOutputStream output = new ByteArrayOutputStream(); if( ElementPicture.getHasContents() == false ) {     ElementPicture.getContents(getContext(), output);     byte[] data = output.toByteArray();     ByteArrayInputStream input = new ByteArrayInputStream(data);     BufferedImage image =; } ...... An access to image e.g. image.getWidth throws an exception Thanks for an answer Translated with (free version)
1 answers

You can do somehting like this:

InputStream inputStream = Core.getImage(getContext(), this.ImageParameter.getMendixObject(), false);
BufferedImage bimg =;