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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top