hi jim, sorry, i don't understand what i must do that my application work. can you show it to me in my example? has it woked for you? greetings michael
Jim Graham schrieb am 15.02.2004 13:22:
Hi Michael,
Yes, I guess you do apply *a* transform to *a* graphics object before you get to the code that draws the text, but it's the wrong graphics object that you apply the scale to.
You are scaling the graphics object that is passed to your paint method - the one that you subsequently hand off to your children. But, the only thing that graphics object is used for when your code is run in its default "buffered" mode is to execute a call to drawImage - thus the only thing it gets a chance to scale are the pixels that have been put into that BufferedImage. But the pixels you placed in that BufferedImage were placed there by a different Graphics object (called "bufferedGraphics" in your example code). This "bufferedGraphics" object never has a scale applied to it so it is rendering the text at a default 1:1 coordinate mapping.
The net result is that the BufferedImage ends up containing pixels representing unzoomed text and you render the pixels of that BufferedImage to the screen via a zoomed (i.e. scaled) Graphics object - thus you get "pixelated" zooming.
What Phil and Emmanuel have been trying to tell you is that you need to have applied a scale to the same graphics object that you execute the "drawString" call on in order to have the text scaled smoothly. You need to draw the text into the BufferedImage using a graphics object that has a zoom applied to it and then copy it to the output graphics with the default (unzoomed) transform.
...jim
--On Thursday, February 12, 2004 9:23 AM +0100 Michael Seele <[EMAIL PROTECTED]> wrote:
please look at my example! i scale the affine transform *before *i call drawText...
Emmanuel Pietriga schrieb am 12.02.2004 08:36:
I think there is a misunderstanding here. You have to apply the scaling affine transform *before* calling drawing primitives such as drawText. If you call it *after* the rendering has been done, i.e. on the rendered buffered image, you're doing image scaling on image pixels as Phil Race said, and there is no way you can get good font rendering with this method (unless, maybe, if you do some antialiasing, but it would not be that good, and would fail with large zooming factors).
Emmanuel
Michael Seele wrote:
thats right. but theres no change when i re-render my image on every zoom change. please look at my example!
Phil Race schrieb am 11.02.2004 16:29:
Michael Seele wrote:
hi guys, i have a big problem: my application shows lot of rectangles which can be dragged on the screen. the application also supports zooming, i implement this with transform scale. is it possible to use double buffering to draw the rectangles(they contains lot of text). when i use the standart bufferedImage, the text looks not very good. for example i add two screenshoots. one in 100% and one in 400%!!! thanks
its not just fonts, its everything. look at the tick marks too. You will need to change your approach. In your case when you scale there's no text drawing happening. Its just image scaling on image pixels. ie you are pre-rendering an image at one resolution and then scaling the image pixels to other resolutions. That is not how to do resolution independent graphics.
You will need to re-render eveything at the requested resolution each time.
-phil.
================================================================== =========
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
-- Mit freundlichen Gruessen Michael Seele([EMAIL PROTECTED])
G & H Softwareentwicklung GmbH Tel.: {+49|0} 7451 - 53 706 0 Robert-Bosch-Str. 23 Fax: {+49|0} 7451 - 53 706 90 D-72160 Horb a.N. http://www.guh-software.de
=================================================================== ========
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
-- Emmanuel Pietriga ([EMAIL PROTECTED]) tel (mobile): +33 6 88 51 94 98 http://claribole.net
==================================================================== =======
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
===================================================================== ====== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
=========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
