answersLogoWhite

0

What is an area of document window that displays the photo or image?

Updated: 8/19/2019
User Avatar

Missgordon

Lvl 1
12y ago

Best Answer

Java Swings has a lot of nice features and one of them is the ability to display images on its components. You can select any image that is available in the local system or somewhere on the internet and display it on Graphics objects. As of Java SE 1.4, reading an image is very simple.

If the image is stored in a local file:

String filename = "...";

Image image = ImageIO.read(new File(filename));

Otherwise, you can supply a URL:

String urlname = "...";

Image image = ImageIO.read(new URL(urlname));

The read method throws an IOException if the image is not available.

Now the variable image contains a reference to an object that encapsulates the image data. You can display the image with the drawImage method of the Graphics class.

public void paintComponent(Graphics g)

{

. . .

g.drawImage(image, x, y, null);

}

Sometimes, you may want to tile an image across a components canvas if it is much smaller than the component size. We can do the tiling in the paintComponent method. We first draw one copy of the image in the top-left corner and then use the copyArea call to copy it into the entire window using the code below:

for (int i = 0; i * imageWidth <= getWidth(); i++) for (int j = 0; j * imageHeight <= getHeight(); j++) if (i + j > 0)

g.copyArea(0, 0, imageWidth, imageHeight, i * imageWidth, j * imageHeight);

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is an area of document window that displays the photo or image?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why was the first photo image created?

To document things, not in words.


How do you change embedded document size 8.5x11 to fit image size 6x9 in photo-shop?

image-Image Size


What does mode selector do in photo shop?

You mean Color Mode? Changing how Photoshop treats and displays colors in an image.


What is the photo size 3.5cm 4.5cm in piexels?

That depend on resolution. Open image in Photoshop and go to Image &gt; Image Size. Pixel dimensions you can see on the top of Image Size window.


How do you send a digital photo document to a fax number when sending a document image using standard telephone line.?

open the photo file so that you can see the picture. Copy and paste the picture in the document or paste it in a document by itself. Then fax it like you would any other document from your computer.


How do you adjust d size of image in photo shop?

Go to Image &gt; Image Size and type numbers or choose Percentage and type percentage in Height or Width fields at top of Image Size window.


How can you re size a photo from 46KB to 600KB?

You can enlarge image in Image Size dialog in Photoshop, Image &gt; Image Size. At top of window you will see current/new size in bytes. When you enlarging images be aware because you can loose quality.


What is the deference between image and picture?

A picture can be a painting, a drawing, and a photo. A image is JUST a photo.


Can you transfer a hand drawn logo into a computer image?

you can,you need scanner and photo editing software


If you take a photo with your own phone or camera of an image on the TV do you have the rights to that photo?

No you do not. The image is still the right to that show.


How do you scan a photo onto the adobe illustrator program?

you cant scan a photo onto adobe illustrator but you have one of two options: 1- placing the image onto the illustrator page as a linked imgae (this means the link/ image must always remain availabe to the file) 2 - embedding the file (this is advisable if you are going to be sending the file through as an illustrator file) TO PLACE: scan the image as you normally do, illustrator has a good tolerance of different image files. then go to FILE -&gt; PLACE -&gt; choose the image from whatever location it is in. If you leave the file as is, you will need to always keep the linked image accessible (as in if you save the ilustrator file on a CD or flash disk you MUST also save the linked image file onto the same place otherwise, the illustrator document willl appear empty and there will be a 'missing link' message.) TO EMBED: follow the same procedure as for placing but then go to WINDOW - &gt; LINKS -&gt; a link window will appear with the name of the linked files in the document - &gt; click on the file you want to embed - &gt; click the upper right corner of the window (there is a little triangular icon) and this will open a short menu - &gt; choose EMBED FILE


Conclusion of photo image editor in c?

conclusion of image editing