com.supermap.mapping

Class BitmapUtils

  • java.lang.Object
    • com.supermap.mapping.BitmapUtils


  • public class BitmapUtils
    extends java.lang.Object
    author : linwenhao date : 2021/12/22 10:51 desc : bitmap Utility class, inner class version: 1.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      BitmapUtils() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static android.graphics.Bitmap compressBitmap(android.graphics.Bitmap bitmap, float many)
      Picture quality compression
      static android.graphics.Bitmap createReflectionBitmap(android.graphics.Bitmap bitmap, float region)
      Get the inverted image method
      static android.graphics.Bitmap cropBitmap(android.graphics.Bitmap bitmap, float wScale, float hScale)
      Crop the picture to scale
      static android.graphics.Bitmap mergeBitmap(android.graphics.Bitmap backBitmap, android.graphics.Bitmap frontBitmap)
      Overlay two bitmaps into a single bitmap based on the length and width of the underlying bitmap
      static android.graphics.Bitmap scaleWithWH(android.graphics.Bitmap bitmap, double w, double h)
      Picture zooming
      static android.graphics.Bitmap viewSnapshot(android.view.View view)
      Take a screenshot of the View(excluding the SurfaceView)
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitmapUtils

        public BitmapUtils()
    • Method Detail

      • mergeBitmap

        public static android.graphics.Bitmap mergeBitmap(android.graphics.Bitmap backBitmap,
                                                          android.graphics.Bitmap frontBitmap)
        Overlay two bitmaps into a single bitmap based on the length and width of the underlying bitmap
        Parameters:
        backBitmap - at the bottom of the bitmap
        frontBitmap - covers the bitmap above
        Returns:
      • viewSnapshot

        public static android.graphics.Bitmap viewSnapshot(android.view.View view)
        Take a screenshot of the View(excluding the SurfaceView)
      • scaleWithWH

        public static android.graphics.Bitmap scaleWithWH(android.graphics.Bitmap bitmap,
                                                          double w,
                                                          double h)
        Picture zooming
        Parameters:
        bitmap - bitmap
        w - New width
        h - New height
        Returns:
        Bitmap
      • cropBitmap

        public static android.graphics.Bitmap cropBitmap(android.graphics.Bitmap bitmap,
                                                         float wScale,
                                                         float hScale)
        Crop the picture to scale
        Parameters:
        bitmap -
        wScale - clipping width 0~100%
        hScale - clipping height 0~100%
      • createReflectionBitmap

        public static android.graphics.Bitmap createReflectionBitmap(android.graphics.Bitmap bitmap,
                                                                     float region)
        Get the inverted image method
        Parameters:
        bitmap -
        region - Reflection region 0.1 to 1
        Returns:
        bitmap
      • compressBitmap

        public static android.graphics.Bitmap compressBitmap(android.graphics.Bitmap bitmap,
                                                             float many)
        Picture quality compression
        Parameters:
        bitmap -
        many - percentage
        Returns: