嘟嘟

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            26 Posts :: 0 Stories :: 6 Comments :: 0 Trackbacks
          Taking a look at SWT Images:網上教程
          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:直接調用
                Image i = new Image(device, "C:\\graphic.bmp");
                //device有2種設備,Display和Printer,寫null,默認使用當前的Display來做顯示設備。
          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
          主站蜘蛛池模板: 拜城县| 呼伦贝尔市| 马鞍山市| 民权县| 永州市| 从江县| 始兴县| 德昌县| 南溪县| 襄樊市| 平乡县| 泾川县| 洪泽县| 密云县| 安陆市| 府谷县| 丘北县| 元氏县| 壤塘县| 黑山县| 平潭县| 化州市| 哈密市| 太仆寺旗| 罗定市| 佛冈县| 普安县| 叙永县| 渭源县| 长治市| 融水| 莫力| 石阡县| 得荣县| 栾川县| 桐庐县| 铜鼓县| 巴楚县| 隆回县| 大兴区| 全州县|