clonebaby59
clonebaby59

Reputation: 187

saving the canvas as a jpg

Want to save the current state of my canvas as a picture, jpg file, how do u do this?

Upvotes: 0

Views: 1205

Answers (2)

MrSok
MrSok

Reputation: 21

bitmap.compress() is what your looking for.

Upvotes: 1

iluxa
iluxa

Reputation: 6969

  • create a new BufferedImage the size of your canvas
  • get its graphics object
  • call your canvas.paint() to paint into the image
  • use ImageIO.save() or whats-it-called to actually save the image

Upvotes: 1

Related Questions