Since i didnt get it working right...
I tried to produce a small sample with the same behaviour, but i cant
produce this with my own small sample.
So i think the prob must be somewhere else in the code of the awt rendering.
Here is my example:
// Sample should show that thin lines disappear while the bufferedimage is
scaled,
// but it doesnt happen, its only happening in the awt-viewer in fop
// Are the lines in Java2DRenderer painted in a different way to this
sample?
package test;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class Test
{
public static void main(String[] args)
{
JFrame f = new JFrame();
f.setSize(200,200);
f.setContentPane(new MyPanel());
f.setVisible(true);
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.setLocationRelativeTo(null);
}
}
class MyPanel extends JPanel
{
private static final long serialVersionUID = 736771368105010125L;
private BufferedImage imageBuffer;
public MyPanel()
{
setLayout(new BorderLayout());
AffineTransform f = new AffineTransform();
f.scale(0.3453543455f,0.3453543455f);
imageBuffer = new BufferedImage(100, 100,
BufferedImage.SCALE_SMOOTH);
Graphics2D graphicsBuffer = imageBuffer.createGraphics();
graphicsBuffer.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
graphicsBuffer.setRenderingHint(RenderingHints.KEY_RENDERING,
RenderingHints.VALUE_RENDER_QUALITY);
graphicsBuffer.setTransform(f);
graphicsBuffer.setColor(Color.WHITE);
graphicsBuffer.draw(new Line2D.Float(30, 10, 0.2f, 10));
graphicsBuffer.draw(new Line2D.Float(40, 10, 0.5f, 20));
graphicsBuffer.draw(new Line2D.Float(50, 10, 0f, 30));
}
public void paintComponent(Graphics g) {
g.drawImage(imageBuffer, 0, 0, null);
}
}
Cheffe wrote:
>
> Me again.
> I tried some changes in the source to find a solution for the prob...
> I did the follow:
>
> -ImageProxyPanel-
> paintComponent(Graphics g)
> {
> getPageasImage(g); // changed the params
> ...
> //g.paintImage(...) //commented out
> }
>
> - i think it was Java2DRenderer -
> getPageasImage(Graphics gg)
> {
> //Graphics g = image.create.Graphics(); //commented out
> Graphics g = gg; //changed the params
> ...
> }
>
> So it painted it directly to the panel, but the lines are still hiding
> when i zoom.
> Any helpful hints are still welcome.
> I tried to investigate how the debuglines in the viewer are made, cause
> the debuglines are painted correctly while scaling but i didnt get it.
> Difficult to understand =)
>
>
> Jeremias Maerki-2 wrote:
>>
>> Oh, I think you hit the nail on the head with that link. It is indeed so
>> that the page is first painted to a bitmap which is then painted on the
>> panel. So, it appears as if painting the page directly on the panel
>> could potentially solve the problem.
>>
>> But what I don't know is whether there was a particular reason that we
>> use (and cache) bitmaps to paint the pages instead of painting them
>> directly. At first glance, it appears to be a waste of a lot of memory.
>> If I were you I'd experiment with changing
>> ImageProxyPanel.paintComponent().
>>
>> On 22.01.2007 13:47:05 Cheffe wrote:
>>>
>>> I found somethin but dont know exactly how to use the info =(
>>> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4109583 Sun Bug
>>> 4109583
>>> Someone says if you us use transed graphics to draw line there is no
>>> prob
>>> anymore.
>>>
>>>
>>> Jeremias Maerki-2 wrote:
>>> >
>>> > It seems more like a general Java2D issue. Can you please search the
>>> web
>>> > for hints? I'm sure someone else has run into a similar problem
>>> before.
>>> > From there we can see if we can find a solution. I don't know off-hand
>>> > how to solve this.
>>> >
>>> > On 22.01.2007 10:54:39 Cheffe wrote:
>>> >>
>>> >> Has anyone also realized this issue in the AWTViewer? A hint is
>>> always
>>> >> welcome =)
>>
>>
>> Jeremias Maerki
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Lines-are-hiding-in-AWTViewer-perhaps-Bug-in-Java2DRenderer-or-Java2D-itsself-tf3049992.html#a8653116
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]