Canvas « Icon Image « Java Swing Q&A





1. creating image from canvas    coderanch.com

hi friends i wanna generate an image of wat i draw on a canvas. i.e. i wanna draw some picture using drawLine,drawOval and other similar methods. and i wanna pick whatever is drawn on canvas as an image. can anybody help me doing this.what r the ways of doing this. thanx harish

2. Image from Canvas    coderanch.com

Manu, The way I would do it is use the createImage( x, y ) method in Component to create a "back buffer" image ( normally used in double buffering ) that you do all the drawing to in your paint method. Then, at the end of the paint method, you simply do a g.drawImage( buffer, 0, 0, this ) to draw ...

3. Loading image in Canvas (Urgent)    coderanch.com

I'm trying to load an image and show it in a Canvas. I used the default toolkit's getImage() to load it, used a MediaTracker to, of course, track it, and it showed me that I got an error loading the image... Why?? Please... I need it working tomorrow. Look at the (sample) code: import java.awt.*; import java.awt.event.*; import java.io.File; import java.net.*; ...

4. Placing an image object on canvas(urgent)    coderanch.com

What's the statement to get the key pressed on the PocketPC if I choose not to use the pen thingy? It's like this, I have one big image divided into 4 small parts, to fit the small PocketPC screen. And when i press the 'Right' arrow button on PocketPC, the screen which is displaying the first part of the big image ...

5. draw image problems Canvas    coderanch.com

Hey Guys, i am drawing an image inside a canvas using Graphics.drawImage(image,dx1,dy1,dx2,dy2,sx1,sy1,sx2,sy2,Color,imageObserver) i am using the imageObserver as the Canvas the canvas is 500x600, so is the applet, and the scrollPane. in short everything is 500x600 the problem i face is that when drawing the image, i set the source parameters (sx...) to the dimenstions of the original image, yet when ...

6. Maximizing + Restoring Image on Canvas * SOLVED *    coderanch.com

Hey all, I've written a small program that allows the user to add points to a canvas, and the program creates a polygon. That all works fine and dandy. The problem I'm coming to is if the user minimizes the program, then maxmimizes it again the canvas is clear until they click in it again (which adds a point). I thought ...

7. how to get Image from Canvas    coderanch.com

Actually, I have only 1 target: resize a photo to a larger size, keeping the ratio. but if the original dimension is not proportional to the target dimension, i want to fill extra area to make it be exact dimension as the target dimension. this is why i am putting the image first into a Canvas, with the background color set, ...