Results 1 to 7 of 7
- 03-03-2010, 12:06 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
-
We have no idea what you're doing wrong currently. You may want to give us more information.
- 03-03-2010, 01:18 PM #3
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
Thanks for replying sir,
Actually i dont know how to start with a code, i am thinking of using BufferedImage and tried of modifying the following code at Combine two images using Java - Open Source University Meetup .. but i am not getting the right output.. please give me guidance...
- 03-05-2010, 05:16 AM #4
Construct a BufferedImage
Obtain its Graphics context
drawString the text
If you want more help, ask a specific question. Not "i dont know how to start"
If that's really your only problem, go through some tutorials. I find thwe ones on the Sun site good.
db
- 03-07-2010, 07:22 AM #5
Member
- Join Date
- Mar 2010
- Posts
- 5
- Rep Power
- 0
hi friend.. i have coded.. but its having a bug.. please help on that in my new thread Struggling with AlphaComposite .. please help me
- 04-23-2010, 03:03 PM #6
Member
- Join Date
- Apr 2010
- Posts
- 4
- Rep Power
- 0
I found the watermarking concept for this but not having coding idea on it..
- 05-07-2010, 06:14 PM #7
Member
- Join Date
- May 2010
- Location
- northern california
- Posts
- 7
- Rep Power
- 0
If I understand your question correctly, you just need to do something like this:
BufferedImage bi = ...;
Graphics2D g2d = ( Graphics2D ) bi.getGraphics();
g2d.setColor( Color.BLACK );
g2d.setFont( new Font( "arial", Font.PLAIN, 30 ) );
g2d.drawString( "Hello World!", bi.getWidth()/2, bi.getHeight()/2 ); // You can use FontMetrics and other classes to get string bounds
g2d.dispose(); // Don't forget to call dispose()!Last edited by rtc1; 05-07-2010 at 06:16 PM. Reason: omitted 2 arguments from drawString()
Similar Threads
-
How to write text file into Array
By venkat.ravala in forum New To JavaReplies: 13Last Post: 11-19-2009, 04:59 PM -
Update existing buffered image
By rosh72851 in forum New To JavaReplies: 24Last Post: 12-04-2008, 03:43 AM -
Write a List into a Text file
By tech2000 in forum New To JavaReplies: 1Last Post: 11-13-2008, 05:09 AM -
need to add text field on existing dialog
By SHAshank1 in forum SWT / JFaceReplies: 0Last Post: 07-23-2008, 03:15 PM -
How to write an image of a given format
By Java Tip in forum java.awtReplies: 0Last Post: 06-25-2008, 10:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks