I am a J2ME programmer, And I use the code lines below to create a Image Buffer.
public void paint(Graphics g) {
…
Image image = Image.createImage(width, height); // creating a mutable Image (Image Buffer)
Graphics imageGraphics = image.getGraphics();
imageGraphics.fillRect(0, 0, width, height); // Draw a rect into the Image buffer
imageGraphics.drawString(“Image Graphics”, width/2, 0,0); // Draw a Text into the Image Buffer
g.drawImage(image, 0, 0, Graphics.TOP | Graphics.LEFT); // Draw Image Buffer on device
}
How can I do the same with Corona, plz ?
But I am coding an app like Microsoft Paint, I need paint many lines, rectangles, circles. And, I had tried using displayGroup, I Inserted many lines (append method), circles , And then the frame rate is very slow because of much heavy painting (repaint many objects). Besides I think It also take a lot of memory.
With Image Buffer, I don’t need to repaint all things, just paint some new circles, line for next frame.
The Image buffer keeps everything painted on it, and never refresh. [import]uid: 30062 topic_id: 6819 reply_id: 23816[/import]