com.supermap.data

类 GeoPicture

  • 所有已实现的接口:
    IDisposable


    public class GeoPicture
    extends Geometry
    二维图片几何类。

    该类继承自 Geometry 抽象类。

    GeoPicture 对象在应用过程中通常被添加到地图或布局中,往往作为 Logo 或者其他标识,因此,GeoPicture 无需像地图或者布局中的其他对象一样需要进行超大倍的缩放浏览,GeoPicture 对象在相对原图大小的100倍以上时,将会以白色方式显示。

    示范代码:
    以下代码示范如何设置 GeoPicture 对象,并将其设置信息输出。
     public void geoPictureTest(){
            // 构造一个 GeoPicture 对象并进行相应设置
            GeoPicture geoPicture = new GeoPicture();
            geoPicture.setCenter(new Point2D(500, 500));
            geoPicture.setHeight(400);
            geoPicture.setWidth(400);
            geoPicture.setImage(new java.awt.image.BufferedImage(350, 300,
                    java.awt.image.BufferedImage.TYPE_BYTE_GRAY));
            geoPicture.setRotation(5);
        }
     
    • 构造器详细资料

      • GeoPicture

        public GeoPicture()
        构造一个新的 GeoPicture 对象。
      • GeoPicture

        public GeoPicture(GeoPicture geoPicture)
        根据给定的 GeoPicture 对象构造一个与其完全相同的新对象。
        参数:
        geoPicture - 给定的 GeoPicture 对象。
      • GeoPicture

        public GeoPicture(BufferedImage image,
                          Point2D center,
                          double width,
                          double height,
                          double rotation)
        根据指定的参数来构造一个 GeoPicture 的新对象。
        参数:
        image - Image 类对象。
        center - 指定的中心点。
        width - 指定的宽度(旋转前)。
        height - 指定的高度(旋转前)。
        rotation - 旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。
      • GeoPicture

        public GeoPicture(BufferedImage image,
                          Rectangle2D bounds,
                          double rotation)
        根据指定的参数来构造一个 GeoPicture 的新对象。
        参数:
        image - Image 类对象。
        bounds - 指定的范围。
        rotation - 旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。
      • GeoPicture

        public GeoPicture(String imageFile,
                          Point2D center,
                          double width,
                          double height,
                          double rotation)
        根据指定的参数来构造一个 GeoPicture 的新对象。
        参数:
        imageFile - 图片文件的全路径。
        center - 指定的中心点。
        width - 指定的宽度(旋转前)。
        height - 指定的高度(旋转前)。
        rotation - 旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。
      • GeoPicture

        public GeoPicture(String imageFile,
                          Rectangle2D bounds,
                          double rotation)
        根据指定的参数来构造一个 GeoPicture 的新对象。
        参数:
        imageFile - 图片文件的全路径。
        bounds - 指定的范围。
        rotation - 旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。
    • 方法详细资料

      • getRotation

        public double getRotation()
        返回二维图片几何对象的旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。

        二维图片几何对象通过数据引擎存储后返回的旋转角度,精度为 0.1 度;通过构造函数直接构造的二维图片几何对象,返回的旋转角度精度不变。

        返回:
        二维图片几何对象的旋转角度。
        默认值:
        默认值为 0。
      • setRotation

        public void setRotation(double value)
        设置二维图片几何对象的旋转角度。二维图片几何对象的形状是矩形,其旋转基点为该矩形的中心点。
        参数:
        value - 二维图片几何对象的旋转角度。
      • getWidth

        public double getWidth()
        返回二维图片几何对象的宽度。
        返回:
        二维图片几何对象的宽度。
        默认值:
        默认值为 1。
      • setWidth

        public void setWidth(double value)
        设置二维图片几何对象的宽度。
        参数:
        value - 二维图片几何对象的宽度。
      • getHeight

        public double getHeight()
        返回二维图片几何对象的高度。
        返回:
        二维图片几何对象的高度。
        默认值:
        默认值为 1。
      • setHeight

        public void setHeight(double value)
        设置二维图片几何对象的高度。
        参数:
        value - 二维图片几何对象的高度。
      • getCenter

        public Point2D getCenter()
        返回二维图片几何对象的中心点。
        返回:
        二维图片几何对象的中心点。
        默认值:
        默认值为 {X = 0,Y = 0}。
      • setCenter

        public void setCenter(Point2D point2D)
        设置二维图片几何对象的中心点。
        参数:
        point2D - 二维图片几何对象的中心点。
      • getImage

        public BufferedImage getImage()
        返回二维图片几何对象使用的图片。
        返回:
        二维图片几何对象使用的图片。
      • setImage

        public void setImage(BufferedImage value)
        设置二维图片几何对象使用的图片。
        参数:
        image - 指定的图片对象。
      • getImageFilePath

        public String getImageFilePath()
      • setImageFilePath

        public void setImageFilePath(String path)
      • clone

        public GeoPicture clone()
        从类复制的说明: Geometry
        克隆一个Geometry对象。
        指定者:
        clone 在类中 Geometry
        返回:
        克隆的Geometry对象。
      • dispose

        public void dispose()
        从类复制的说明: Geometry
        释放该对象所占用的资源。当调用该方法之后,此对象不再可用。
        指定者:
        dispose 在接口中 IDisposable
        指定者:
        dispose 在类中 Geometry

Copyright © 2021–2024 SuperMap. All rights reserved.