tailieunhanh - Object Oriented Programming using Java phần 8

Nếu x là một biến thể hiện trong cùng một đối tượng, sau đó có thể được sử dụng như một tên đầy đủ cho rằng biến. Nếu otherMethod () là một phương pháp thể hiện trong cùng một đối tượng, sau đó | Draws a card in a 79x123 pixel rectangle with its upper left corner at a specified point x y . Drawing the card requires the image file . @param g The graphics context used for drawing the card. @param card The card that is to be drawn. If the value is null then a face-down card is drawn. @param x the x-coord of the upper left corner of the card @param y the y-coord of the upper left corner of the card public void drawCard Graphics g Card card int x int y int cx x-coord of upper left corner of the card inside cardsImage int cy y-coord of upper left corner of the card inside cardsImage if card null cy 4 123 coords for a face-down card. cX 2 79 else cx -1 79 switch case cy 0 break case cy 123 break case cy 2 123 break default spades cy 3 123 break cardImages x y x 79 y 123 cx cy cx 79 cy 123 this I will tell you later in this section how the image file can be loaded into the program. Image File I O The class makes it easy to save images from a program into files and to read images from files into a program. This would be useful in a program such as PaintWithOffScreenCanvas so that the users would be able to save their work and to open and edit existing images. See . There are many ways that the data for an image could be stored in a file. Many standard formats have been created for doing this. Java supports at least three standard image formats PNG JPEG and GIF. Individual implementations of Java might support more. The JPEG format is lossy which means that the picture that you get when you read a JPEG file is only an approximation of the picture that was saved. Some information in the picture has been lost. Allowing some information to be lost makes it possible to compress the image into a lot fewer bits than would otherwise be necessary. Usually the approximation is quite good. It works best for 155 photographic images and worst .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.