I have been running into issues with the repaint event handler taking up too much of the client resources. This code takes the byte array into an image. Recently the images we have displaying became higher resolution. The byte array expanded from ~80,000 to ~500,000. I have taken some tips from slower/stop repainting but it is still quite slow client side, within my designer it perform well. I am not sure what I can do to improve performance.
g = event.graphics bytes = system.file.readFileAsBytes("C:\\imagefile.PNG") if bytes: from javax.imageio import ImageIO from java.io import ByteArrayInputStream image = ImageIO.read(ByteArrayInputStream(bytes)) scaledImage = image.getScaledInstance(700,600,0) g.drawImage(scaledImage,0,-15,event.source)
g = event.graphics filename = "C:\\imagefile.PNG" image = event.source.getClientProperty("img-cached") if not event.source.manualTextFieldModified and image: g.drawImage(image, 0, 0, 820, 615, event.source)
filename = "C:\\imagefile.PNG" image = event.source.getClientProperty("img-bytes-cached") if event.source.manualTextFieldModified or not image: from javax.imageio import ImageIO from java.io import ByteArrayInputStream bytes = system.file.readFileAsBytes(filename) image = ImageIO.read(ByteArrayInputStream(bytes)) event.source.putClientProperty("img-cached",image) system.tag.write("manualTextFieldModified", 0)