?
Solved

Create an image out of a graphics source

Posted on 1998-01-06
1
Medium Priority
?
185 Views
Last Modified: 2006-11-17
I want to write a string (with a font) to an offscreen graphic and then create out of this an image object for further usage. The way to get the graphics from an image seems easy to me. But how works it the other way round?
Help would be appreciated very much!!
0
Comment
Question by:mwaber
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
jpk041897 earned 300 total points
ID: 1231997
If you create a derived Canvas, you can use the:

java.awt.Graphics.drawString()  

method to write your strings into your image inside an overide of the paint method. I.e.:

     public void paint(Graphics g)
          {
          ...
             g.drawString("Your Text", x, y);
          ...
          }

Another alternative, albeit more complex could be to use the clipboard.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month9 days, 4 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question