[JAVA2D] Zoom relative to mouse position

2008-05-19 Thread java2d
Hi, I am trying to figure out how to zoom relative to the mouse pointer position. Below, please find my sample code. When I position the mouse pointer on one corner of the red rectangle and use the mouse wheel, I am able to zoom in and out as expected. As soon as I move the pointer position,

[JAVA2D] Developing a CAD Engine

2008-05-19 Thread java2d
I am developing a CAD Engine Using Java Technology. I need assistance of those peoples worked with Java Graphics. What i need is nothing but my programme could perform basic drawings feature i.e. draw line, draw rectangle, circle insert text and etc. for this i need a bit assistance. any

Re: [JAVA2D] JAI package (show an error that package doesn't exist)

2008-05-19 Thread java2d
Hello experts: Please help me for this. I've install JAI package to my c:\ root and have added C:\jai-1_1_2_01\lib to my CLASSPATH value. How do i use the JAIPlugIn class? do i add it to one of my package then set it as my jai.class in my properties object? How do i start? Is there step by

[JAVA2D] Prototype applet using BufferedImage...

2008-05-19 Thread Ken Warner
If I do this to get the pixels from an image for later rendering in a MemoryImageSource my applet runs fine. width = image.getWidth(canvas); height = image.getHeight(canvas); pixels = new int [width * height ]; int cnt = 0; pg = new

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Jim Graham
When I run the applets from appletviewer I see 16 numbers printed on the console for the BI version but only 8 printed for the PG version - hopefully there isn't a typo causing the loads to be done twice? ...jim Ken Warner wrote: Hi Jim, I'm not communicating the

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
I just thought of something. What is the alpha channel set to when the BufferedImage is created and the databuffer is extracted? If the alpha channel is 0, that would explain a lot. That means the image is transparent. There's two stages of rendering. The first stage only does nearest

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Jim Graham
The 3byte databuffer has no storage available for an alpha value. When the data is loaded into the TYPE_INT_RGB BufferedImage there is no alpha stored there since that is an opaque type. More specifically, if you load one of the integers from the underlying int[] pixel array of such an image

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
Whatever... The image was not being drawn because the alpha channel was 0x00. Initializing the alpha channel to 0xff allowed us to see the image. I don't have a lot of energy for a big discussion about this. But this whole experiment still leads me back to ask for a way to decode an image

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Jim Graham
Hi Ken, I'm sorry that you are having trouble understanding the newer imaging APIs as they generally provide facilities that are quite flexible and useful for writing the type of application that you are creating here. The primary missing link would seem to be some documentation that would

Re: [JAVA2D] I need a way to decode an image file directly into a byte or integer array...

2008-05-19 Thread Ken Warner
I understand the newer imaging API's well enough to know they are awkward and lacking in flexibility and utility. I understand your responses well enough to know when I'm being sandbagged. I understand that any request to do anything different from the Gold Standard of Perfection that exists