Re: [JAVA2D] resizing image in a canvas

1999-01-02 Thread Joe Sam Shirah
Hi Csongor, I'm sure that I am missing something, but couldn't you create a second BI big enough to accomodate your largest zoomed Shape ( or zoomed area, ) and then reuse/redraw as you go, using the appropriate height and width?

Re: [JAVA2D] resizing image in a canvas

1999-01-02 Thread Joe Sam Shirah
Hi Csongor, Well, there's magic... Sorry, couldn't resist. Obviously this work has to be done SOMEWHERE. So, even if you could just pass it off to another class, possibly JAI as you mentioned previously, something like that is getting done. Is it more elegant to pass to a hidden

Re: [JAVA2D] BufferedImage vs MemoryImageSource

1999-01-02 Thread Graeme Wallace
Hi, I can make some guesses as to how they were designed that might give better performance. If they store the images in VRAM, then they can take advantage of hardware acceleration for the blits to the screen. The downside is that the Windows APIs for doing this are very limited and so you

Re: [JAVA2D] BufferedImage vs MemoryImageSource

1999-01-02 Thread Jim Graham
Hi Graeme, I can make some guesses as to how they were designed that might give better performance. If they store the images in VRAM, then they can take advantage of hardware acceleration for the blits to the screen. The downside is that the Windows APIs for doing this are very limited

Re: [JAVA2D] zooming in out

1999-01-02 Thread John Caron
I am setting my stroke to width 0, which i think means use one pixel line width. So this works at whatever zoom level. g.setStroke(new java.awt.BasicStroke(0.0f)); BasicStroke here takes user coords, so to use some other constant pixel width, you have to calculate what the width is in

Re: [JAVA2D] resizing image in a canvas

1999-01-02 Thread John Caron
You only have to create a new BufferedImage when the user resizes the window. Zooming and panning is done with a redraw to the existing image. Hi Joe Sam, Yes, I could but it's not elegant. Why do I have to recreate in every zooming step one large (~MB size) buffer? Or are there no other

[JAVA2D] Hit testing

1999-01-02 Thread Satish Annapureddy
Hi, I have a canvas that displays Shapes (described in application specific world coords) by converting them from world space to screen space (by using the appropirate coord. converter). I need to implement an efficient hit testing method to select the Shape that is under the mouse click. The

[JAVA2D] intersects()- outline of Bez. curve

1999-01-02 Thread Satish Annapureddy
Hi, I want to detect intersections of a small rectangle with the outline of an open-ended (ie., no close path between the end points) CubicCurve2D. I am doing a (ccurve.intersects(rect) == true ccurve.contains(rect) == false) but this still does not eliminate the cases when the rect includes

Re: [JAVA2D] BufferedImage vs MemoryImageSource

1999-01-02 Thread Julian L Brown
Hi Jim, Can you suggest a way (or a program) to objectively measure the speed of copying an image from memory to the screen? In a later message, you mentioned that you were getting 30M pixels/sec and it would be interesting to compare the results I get with what you found. My comparison was

Re: [JAVA2D] BufferedImage vs MemoryImageSource

1999-01-02 Thread Jim Bucher
Then use direct draw. You have access to everything there. DD is a b*tch to deal with, but it would make everyone happy to have acceleration in Swing/AWT/Java2D. JDK 1.1 also used CreateDIBSection for media/toolkit images. The images are stored in main memory and not accelerated. This is no