Rendering Styled Text to BufferedImage

T

Tom Davies

I'm writing an application which will produce a slideshow of jpgs. Part
of the slide is text, which I want to allow the user to edit in a JTextPane.

I understand how to use a JTextPane along with a StyledEditorKit to
produce a StyledDocument, and I understand how to use AttributedString
and TextLayout to draw styled text onto a BufferedImage.

I'm having trouble putting the two together: is there an easy way to get
AttributedStrings out of my JTextPane? Or can I somehow use a JtextPane
to render to my BufferedImage directly?

Thanks,
Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top