try {
QTSessionCheck.check();
// import a graphic
QTSessionCheck.check();
QTFile inFile = QTFile.standardGetFilePreview (imagetypes);
GraphicsImporter importer =
new GraphicsImporter (inFile);
showFrameForImporter (importer,
"Original Import");
// get a pict object and then save it
// then load again and show
Pict pict = importer.getAsPicture();
String absPictPath = (new File ("pict.pict")).getAbsolutePath();
File pictFile = new File (absPictPath);
if (pictFile.exists())
pictFile.delete();
try { Thread.sleep (1000); } catch (InterruptedException ie) {}
pict.writeToFile (pictFile);
QTFile pictQTFile = new QTFile (pictFile);
GraphicsImporter pictImporter =
new GraphicsImporter (pictQTFile);
showFrameForImporter (pictImporter,
"pict.pict");
// write to a pict file from importer
// then load and show it
String absGIPictPath = (new File ("gipict.pict")).getAbsolutePath();
QTFile giPictQTFile = new QTFile (absGIPictPath);
if (giPictQTFile.exists())
giPictQTFile.delete();
try { Thread.sleep (1000); } catch (InterruptedException ie) {}
importer.saveAsPicture (giPictQTFile,
IOConstants.smSystemScript);
GraphicsImporter giPictImporter =
new GraphicsImporter (giPictQTFile);
showFrameForImporter (giPictImporter,
"gipict.pict");
} catch (Exception e) {
e.printStackTrace();
}