Tag:bitmap

  • Conversion between bitmap and bitmapimage in WPF (c)

    Time:2019-12-6

    I. set ImageSource in image control of WPF image1.Source = new BitmapImage(new Uri(@”image file path”, Urikind.RelativeOrAbsolute)); You can also use: System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.Open, System.IO.FileAccess.Read); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); fs.Close(); fs.Dispose(); System.IO.MemoryStream ms = new System.IO.MemoryStream(buffer); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = ms; bitmapImage.CacheOption = BitmapCacheOption.OnLoad; bitmapImage.EndInit(); […]

  • Details of bitmap’s memory cache and disk cache

    Time:2019-10-19

    The original was launched on wechat public account: jzman blog, welcome to pay attention to communication! The use of cache in Android is quite common. Using the corresponding cache strategy can reduce the consumption of traffic and improve the performance of the application to a certain extent. For example, when loading network pictures, you should […]

  • Redis uses get command to read bitmap-type data

    Time:2019-7-18

    In the check-in statistics scenario, bitmap data type can be used to store check-in data efficiently, but the getbit command can only get a bit value, so it can not satisfy some business scenarios optimally. For example, we store a user’s check-in status annually for 365 days, only 365/8_46 Byte, and only 44 MB per […]

  • Simple records between Bitmap, File and Uri in Android

    Time:2019-4-19

    Introduction: I feel that Uri, File and bitmap are confused. Here is a record for later viewing. Let’s see the detailed introduction together. Bitmap, File and Uri 1. Converting a file path to File String path ; File file = new File(path) 2. Convert a Uri to a path Take choosing a picture as an […]