Android Multimedia Handling Guide: Images, Audio, and Video
Image Processing
Efficiently loading large images requires calculating a sample size to avoid memory overflow (OutOfMemoryError). By setting inJustDecodeBounds to true, you can retrieve image dimensions without loading the pixel data into memory.
public void scaleImage(String path, int targetWidth, int targetHeight) {
BitmapFactory.Options ...
Posted on Thu, 05 Nov 2026 16:24:24 +0000 by vhaxu
In-Depth Explanation of Redis Specialized Data Structures: Geospatial, HyperLogLog, and Bitmap
Geospatial Indexing
Redis models geospatial data using a sorted set under the hood. Each entry pairs a location label with its longitude and latitude, scored by spatial distance. Internally, positions are encoded via the GeoHash algorithm; the resulting hash becomes the member of the sorted set, while the distance metric serves as the score. Ra ...
Posted on Wed, 28 Oct 2026 16:36:37 +0000 by xangelo
Working with Android Bitmaps: Creation, Loading, and Rendering
Creating a New Bitmap Instance
A fresh bitmap can be alloacted by specifying dimensions and a pixel configuration. Here, a mutable 24-bit RGB image without an alpha channel is generated:
int canvasWidth = 400;
int canvasHeight = 300;
Bitmap mutableBitmap = Bitmap.createBitmap(canvasWidth, canvasHeight, Bitmap.Config.RGB_565);
The RGB_565 confi ...
Posted on Sun, 04 Oct 2026 16:13:16 +0000 by sankaty
Redis GEO, BitMap, and HyperLogLog for Location-Based Services
Nearby Shops
Redis GEO data structures enable efficient nearby shop queries. The key pattern uses a prefix combined with shop type ID, with each GEO entry storing a shop identifier and its geographic coordinates.
Data Import
A unit test populates Redis with shop location data from MySQL:
@Test
void loadShopData() {
// Fetch all shops from d ...
Posted on Sat, 03 Oct 2026 16:53:13 +0000 by shoz
Writing HBITMAP to BMP File in C++
This documnet covers the process of converting a Windows bitmap handle (HBITMAP) into a standard BMP file on disk. The implementation handles all necessary structures including file headers, info headers, and optional palette data.
The export process follows these key steps:
Open a file for binary writing
Determine the color depth for the targ ...
Posted on Wed, 26 Aug 2026 16:53:37 +0000 by rp2006
Creating Transparent Bitmaps in Android
Android applications often require transparent bitmaps for features like custom graphics rendering or adding watermarks. This guide demonstrates how to create a transparent Bitmap in Android with code examples.
Bitmap Fundamentals
In Android development, Bitmap represents an image and is used for loading, displaying, and manipulating pictures. ...
Posted on Mon, 17 Aug 2026 16:10:44 +0000 by renojim
Understanding Cardinality Estimation Algorithms
For example, consider an array a[10] = {1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7}. The task is to count the number of distinct elements, which in this case would be {1, 2, 3, 4, 5, 6, 7}, totaling seven unique values. Similarly, in web analytics, you may want to track individual users like "Xiaoming" with out repeatedly counting their visits, ...
Posted on Mon, 06 Jul 2026 16:59:54 +0000 by AchillesForce
Android Drawable Resources: Types and Implementation
Drawable resources represent graphical elements that can be rendered on screen and retrieved via APIs like getDrawable(int). They can be applied to XML attributes such as android:drawable and android:icon. Various drawable types include:
Bitmap Files: Image files (.png, .jpg, .gif) that create BitmapDrawable objects
Nine-Patch Files: Scalable ...
Posted on Mon, 01 Jun 2026 16:45:40 +0000 by maliary
Converting HImage to Bitmap in C# for RGB Channel Images
When working with Halcon's HImage objects in C#, converting them into standard .NET Bitmaps can present performance challenges, especial when dealing with color images that have separate red, green, and blue channels.
The key issue revolves around correctly interpreting pointer data returned by Halcon methods like GetImagePointer3. When this me ...
Posted on Sat, 09 May 2026 22:14:49 +0000 by dickd