Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Swing / AWT / SWT
batik and ImageIO.write
mic ta
Greenhorn
Posts: 28
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello,
I tried to rewrite the following code snipsel:
BufferedImage chr = new BufferedImage(IMAGE_WEIGHT, IMAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB); Graphics2D g2 = chr.createGraphics(); g2.setColor(Color.white); g2.fillRect(0, 0, IMAGE_WEIGHT, RULER_FONT_SIZE+RULER_LINE_SIZE+1); g2.setColor(Color.BLACK); g2.fillRect(x - 1, RULER_FONT_SIZE + 1, SABNP_WIDTH, RULER_LINE_SIZE); g2.setFont(new Font("SansSerif", Font.PLAIN, RULER_FONT_SIZE)); g2.drawString(x/10 +" M", x - 2, RULER_FONT_SIZE); OutputStream out = new BufferedOutputStream(new FileOutputStream(outputImg)); ImageIO.write(chr, "png", out);
with Batik, but I do not know how do it.
Are there any examples?
Thank you in advance.
Ulf Dittmer
Rancher
Posts: 43081
77
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What do you mean by "rewrite with Batik"? Are you looking for an SVG snippet that accomplishes the same as this code? Or something else?
mic ta
Greenhorn
Posts: 28
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sorry. Yes, I would like to save the picture in SVG format and not in PNG.
Ulf Dittmer
Rancher
Posts: 43081
77
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Start here:
http://xmlgraphics.apache.org/batik/using/svg-generator.html
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
way to rotate without using Graphics2D.rotate()
Running Method more than once results in wrong results
Custom JComponent Problem
Showing Image in JFrame with g.drawImage() - increasing memory usage by switching image
Showing JSP output in XSL
More...