1 / 22

Example Program

Example Program. DemoMouseInk.java. Example Program. DemoMouseUnistrokes.java. Images. DemoImage.java. DemoImage2.java. Text. Characterized by Font family Style Size and Spacing. Font Families. Three types Serif

moana
Télécharger la présentation

Example Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Example Program DemoMouseInk.java

  2. Example Program DemoMouseUnistrokes.java

  3. Images DemoImage.java DemoImage2.java

  4. Text • Characterized by • Font family • Style • Size and Spacing

  5. Font Families • Three types • Serif • A serif is a short line extending from and at an angle to the upper and lower strokes of a letter • Serif fonts facilitate human perception in distinguishing among letters • Sans serif • Without serifs • Monospaced or fixed-pitch • Each character occupies the same amount of horizontal space

  6. serifs Serifs Illustrated AB ab AB ab Times roman Bookman oldstyle

  7. Sans Serifs Illustrated CD cd CD cd Arial Lucida sans

  8. Monospaced Illustrated IM im IM im Courier new OCR A Extended

  9. Font Style Hello Java World • Plain • Italic • Bold • Italic + bold Hello Java World Hello Java World Hello Java World

  10. Font Size • Font size is measured in points • A point is the smallest typographical unit of measurement • 1 point = 1 / 72 inch (i.e., 72 points per inch) Hello Java World 48 point font size

  11. Font Spacing

  12. Readability of Text • Guidelines: • Uppercase vs lowercase • WORDS WRITTEN IN BLOCK CAPITALS take longer to read than those written in lowercase • However, an important word written in CAPITALS is quickly perceived provided it is surrounded by words in lowercase • Serif vs. sans serif • For printed text, serif fonts are easier to run one’s eyes along and take in the written content • For on-screen text, serif fonts generally produce less well than sans serif fonts due to poorer resolution of the display

  13. Example Program (shown earlier)

  14. Example Program DemoList3.java

  15. Image File Formats • There are many, many file formats for storing images • These include… • gif, jpg, tiff, bmp

  16. gif • gif = graphics interchange format • Pronounced giff (with a hard ‘g’) • Introduced in 1987 by CompuServe Inc. • Very popular format for web pages • Features • Limited to 256 colors (8-bit) • Lossless data compression (compresses best for images with lots of repetition; e.g., flat colors) • Support for transparency • one colour in the image’s pallete (usually the ‘background’) is treated as transparent • Support for animation

  17. jpg • jpg = jpeg = joint photographic experts group • Pronounced jay-peg • Features • Always uses 24-bit color • Lossy data compression (up to 95% reduction, but with loss of image quality proportional to amount of compression)

  18. tiff • tif = tiff = tagged image file format • Features • Supports different compression schemes (lossy and lossless) • Supports any resolution • Black and white, color, or grey shades

  19. bmp • bmp = bit-map • Standard for Windows environment • Uses a pixel map to hold line-by-line raster information • Features • No compression • Files are large

  20. Example (1) jpg, tif, bmp Transparent gif Format File Size gif 1639 jpg 5522 tif 3328 bmp 7942

  21. Example (2) Animated gif with transparentbackground

  22. Programming Challenge Solution • Create a GUI layout, as follows After resizing Upon launching Enter some text: Enter some text: Exit Clear Exit Clear

More Related