当前位置: 首页>>代码示例>>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;未经允许,请勿转载。