嘟嘟

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            26 Posts :: 0 Stories :: 6 Comments :: 0 Trackbacks
          Taking a look at SWT Images:網(wǎng)上教程
          org.eclipse.swt.graphics 包情況:
          Interfaces 
          Drawable
          ImageLoaderListener
          Classes 
          Color
          Cursor
          Device
          DeviceData
          Font
          FontData
          FontMetrics
          GC
          GCData
          Image
          ImageData
          ImageLoader
          ImageLoaderEvent
          PaletteData
          Point
          Rectangle
          Region
          RGB
          Images類使用介紹:
          There are two primary ways to use Images.
          1:直接調(diào)用
                Image i = new Image(device, "C:\\graphic.bmp");
                //device有2種設(shè)備,Display和Printer,寫null,默認(rèn)使用當(dāng)前的Display來做顯示設(shè)備。
          2:控制顏色分配
              ImageData data = new ImageData("C:\\graphic.bmp");
              RGB[] rgbs = data.getRGBs();
              // At this point, rgbs contains specifications of all
              // the colors contained within this image. You may
              // allocate as many of these colors as you wish by
              // using the Color constructor Color(RGB), then
              // create the image:
              Image i = new Image(device, data);

          相對路徑:
          Image i = new Image(device, "icons/graphic.bmp");   //項目根目錄下

          插件自帶圖像
          ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages():
          Image image = sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);

          ImageLoader類使用介紹:保存圖片
          ImageLoader imageLoader = new ImageLoader();
          imageLoader.data = new ImageData[] {imageData};                 
          //The reason the data field is an array of ImageData is to support
          //image file formats with more than one frame such as animated GIFs or interlaced JPEG files.

          imageLoader.save("C:/temp/Idea_PureWhite.jpg",SWT.IMAGE_JPEG);

          .......to be continue

          posted on 2007-06-17 14:56 fyp1210 閱讀(2170) 評論(0)  編輯  收藏 所屬分類: RCP&SWT&JFACE
          主站蜘蛛池模板: 布尔津县| 禄劝| 贺州市| 耒阳市| 东光县| 错那县| 塘沽区| 乌什县| 和田市| 靖西县| 临泉县| 宜都市| 嵊州市| 临猗县| 神木县| 大田县| 南安市| 拉萨市| 兴国县| 寿光市| 库车县| 葫芦岛市| 余干县| 武川县| 昆明市| 交口县| 浮梁县| 永善县| 新营市| 呼伦贝尔市| 南汇区| 北京市| 辽中县| 阿荣旗| 固安县| 德格县| 汉川市| 南澳县| 耒阳市| 邢台市| 阿巴嘎旗|