January 2005
Intermediate to advanced
256 pages
6h 34m
English
QuickTime offers many
components whose job is to import from
and export to different graphics formats. As you might expect, these
components are wrapped by classes called
GraphicsImporter
and GraphicsExporter.
The GraphicImportExport example application (shown
in Example 4-3) uses both of these classes to
illustrate the dynamic lookup of importers and exporters.
Compile and run this example with ant run-ch04-graphicimport-export..
Example 4-3. Graphics import and export
package com.oreilly.qtjnotebook.ch04; import quicktime.*; import quicktime.io.*; import quicktime.std.*; import quicktime.std.comp.*; import quicktime.std.image.*; import quicktime.app.view.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.Vector; import java.io.*; import com.oreilly.qtjnotebook.ch01.QTSessionCheck; public class GraphicImportExport extends Object { Button exportButton; Frame frame; GraphicsImporter importer; static final int[ ] imagetypes = { StdQTConstants.kQTFileTypeQuickTimeImage}; /* other interesting values: StdQTConstants.kQTFileTypeGIF, StdQTConstants.kQTFileTypeJPEG, StdQTConstants4.kQTFileTypePNG, StdQTConstants4.kQTFileTypeTIFF StdQTConstants.kQTFileTypeMacPaint, StdQTConstants.kQTFileTypePhotoShop, StdQTConstants.kQTFileTypePICS, StdQTConstants.kQTFileTypePicture, */ public static void main (String[ ] args) { new GraphicImportExport( ); } public GraphicImportExport( ) { try { QTSessionCheck.check( ); QTFile inFile ...Read now
Unlock full access