當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageIO.getReaderMIMETypes方法代碼示例

本文整理匯總了Java中javax.imageio.ImageIO.getReaderMIMETypes方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageIO.getReaderMIMETypes方法的具體用法?Java ImageIO.getReaderMIMETypes怎麽用?Java ImageIO.getReaderMIMETypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.imageio.ImageIO的用法示例。


在下文中一共展示了ImageIO.getReaderMIMETypes方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import javax.imageio.ImageIO; //導入方法依賴的package包/類
public static void main (String[] args) throws IIOException {
    // Verify getReaderMIMETypes() behavior by keeping MIMEType as null.
    TestImageReaderSpi mimeNullReadSpi =
            new TestImageReaderSpi(FORMATNAMES, SUFFIXES, null);
    IIORegistry.getDefaultInstance().
            registerServiceProvider(mimeNullReadSpi);
    ImageIO.getReaderMIMETypes();
    IIORegistry.getDefaultInstance().
            deregisterServiceProvider(mimeNullReadSpi);

    /*
     * Verify getReaderFileSuffixes() behavior by keeping
     * file suffix as null.
     */
    TestImageReaderSpi suffixNullReadSpi =
            new TestImageReaderSpi(FORMATNAMES, null, MIMETYPES);
    IIORegistry.getDefaultInstance().
            registerServiceProvider(suffixNullReadSpi);
    ImageIO.getReaderFileSuffixes();
    IIORegistry.getDefaultInstance().
            deregisterServiceProvider(suffixNullReadSpi);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:23,代碼來源:GetReaderWriterInfoNullTest.java

示例2: ImageDataContentHandler

import javax.imageio.ImageIO; //導入方法依賴的package包/類
public ImageDataContentHandler() {
    String[] mimeTypes = ImageIO.getReaderMIMETypes();
    flavor = new DataFlavor[mimeTypes.length];
    for(int i=0; i < mimeTypes.length; i++) {
        flavor[i] = new ActivationDataFlavor(Image.class, mimeTypes[i], "Image");
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:8,代碼來源:ImageDataContentHandler.java

示例3: ImageDataContentHandler

import javax.imageio.ImageIO; //導入方法依賴的package包/類
public ImageDataContentHandler() {
    String[] mimeTypes = ImageIO.getReaderMIMETypes();
    flavor = new DataFlavor[mimeTypes.length];
    for(int i=0; i < mimeTypes.length; i++) {
        flavor[i] = new ActivationDataFlavor(
            java.awt.Image.class, mimeTypes[i], "Image");
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:ImageDataContentHandler.java

示例4: main

import javax.imageio.ImageIO; //導入方法依賴的package包/類
public static void main(String[] args) {
    SecurityManager sm = System.getSecurityManager();
    System.out.println("Sm is " + sm);

    String formatNames[] = ImageIO.getReaderFormatNames();
    String readerMimeTypes[] = ImageIO.getReaderMIMETypes();

    if (!isPresent(dummyformatNames, formatNames) ||
        !isPresent(dummymimeType, readerMimeTypes)) {
        throw new RuntimeException("No test plugin available!");
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:13,代碼來源:IIOPluginTest.java

示例5: testGetReaderMIMETypes

import javax.imageio.ImageIO; //導入方法依賴的package包/類
private static void testGetReaderMIMETypes() {
    String[] types = ImageIO.getReaderMIMETypes();
    for (String t : types) {
        Iterator<ImageReader> it = ImageIO.getImageReadersByMIMEType(t);
        if (!it.hasNext()) {
            throw new RuntimeException("getReaderMIMETypes returned " +
                                       "an unknown type: " + t);
        }
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:11,代碼來源:GetReaderWriterInfo.java

示例6: showReadFormats

import javax.imageio.ImageIO; //導入方法依賴的package包/類
/**
 * Show read formats
 * <p>
 * On Windows supports png/jpeg/bmp/gif
 */
public void showReadFormats() {
    String[] formats = ImageIO.getReaderMIMETypes();
    for (String f : formats) {
        System.out.println("r" + f);
    }
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:12,代碼來源:StandardImageHandler.java


注:本文中的javax.imageio.ImageIO.getReaderMIMETypes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。