bitmap

Android: Image cache stategy and memory cache size

Hi Guys! I'm implementing an image cache system for caching downloaded image. My strategy is based upon two-level cache: Memory-level and disk-level. My class is very similar to the class used in the droidfu project My downloaded images are put into an hashmap and the Bitmap objet is wrapped inside a SoftRererence object. Also every ...

How to filter a specific color from a bitmapData object (or byte-array)

I'm looking for an efficient way to filter a specific color from a bitmapData object in ActionScript 3. Currently I use a loop with readByte32(). This takes about a second to process which is unacceptable. I have been trying to get paletteMap() to work but so far haven't been able to grasp its API (any truly useful links? Google has ...

Image not displaying in ms word after converting it from Bitmap to RTF (but displaying in wordpad)

Hi, I am trying to convert a bitmap file to rtf using Delphi 2007. I used below code for conversion. function BitmapToRTF(pict: TBitmap): string; var bi, bb, rtf: string; bis, bbs: Cardinal; achar: ShortString; hexpict: string; I: Integer; begin GetDIBSizes(pict.Handle, bis, bbs); SetLength(bi, bis); SetLength(bb, bbs)...

Create image from view/screen in Android

Is it possible to create a bitmap image from a view or the screen in Android? ...

Out of memory error while loading a Bitmap

Hello everybody, I'm working with big size images (for ex. 16000x9440 px) and cut some regions for other things. I'm getting an exception "Out of memory" when create a new Bitmap instance: using (FileStream fileStream = new FileStream(mapFileResized, FileMode.Open)) { byte[] data = new byte[fileStream.Length]; fileStream.Read(d...

Rotate a bitmap in android about a point without animation of view.

I found some good resources for rotating a bitmap in android here and elsewher eon the net. I am close to getting my code to work but apparently I don't fully understand how the Matrix Translations work. The following is three main functions from my sprite class. THey worked great before I added things to facilitate the matrix rotatio...

Make Bitmaps listen to touch events

Hi all! How can I add touch capabilities to a simple bitmap? I've tried to create a wrapper class for a bitmap, which implemented OnGestureListener, but it didn't work. I want to avoid extending View class to achieve this. Thanks! ...

What is an efficient algorithm to copy pixels that are inside a quadrangle?

I have two bitmaps, and I want to copy pixels from A to B only when the pixels are inside an area defined by four corners (a quadrangle). Bitmap A and B are the same size and the quadrangle is defined as four {x,y} coordinates in the pixel space of the image. Worst case scenario I can test the center of each pixel against the quad to se...

How to write a huge JPEG that exceeds the physical RAM using Delphi ?

Hi all, Here is the problem. I have a large set of 512x512 pixels JPEG tiles as regular jpg files. I have written a piece of software that does a bunch of things and does need to stitch all those files into a single huge JPEG at the end. First of all, I do NOT wish to use ImageMagick to do this, but perform it inside my software ! In...

Monochrome Bitmap

Should be an easy one. I'm working on Scala trying to handle long sequences of binary data. That is long lists of 0's and 1's. What is the 'best' way to store/access this kind of data. The important point here is memory optimisation, so I would like to avoid using an entire byte to store a boolean. Also access is somwhat important, so ...

Drawing on 8bpp grayscale bitmap (unmanaged C++)

Hi all, I've been attempting to draw on an 8bpp grayscale bitmap without success. Here are some of my attempts. Maybe someone can point out what I'm doing wrong. =================================================== Attempt 1: Create, select, and draw: In constructor: CBitmap bm; bm.CreateBitmap (200, 200, 1, 8, NULL); In OnDraw: ...

Display bitmap of any size in Android

I want to display a bitmap read from the SD card at actual pixel size in Android. I can't assume anything about the bitmap, other than Android supports its image format. The bitmap might be huge. Seems simple enough, but when you factor Android memory limitations it gets much more complicated. Any ideas? Edit: Attempting to load a la...

Determine bits per pixel in a bitmap

What's the easiest way to tell the number of bits per pixel in a bitmap, e.g. a Windows .bmp file? ...

How to draw on given bitmap handle (C++ / Win32)?

I'm writing an unmanaged Win32 C++ function that gets a handle to a bitmap, and I need to draw on it. My problem is that to draw I need to get a device context, but when I do GetDC (NULL), it gives me a device context for the WINDOW! The parameter for GetDC () is a window handle (HWND), but I don't have a window; just a bitmap handle. ...

Unexpected "Bitmap Region is already Locked" exception with GetEncoderParameterList. Any ideas?

I'm trying to use this sample code from Microsoft to determine what encoder options are available for the JPEG encoder. (The real problem I'm trying to solve is to see if I can set the Chroma subsampling parameters explicitly) http://msdn.microsoft.com/en-us/library/bb882589.aspx private void GetSupportedParameters(PaintEventArgs e) { ...

How to save bitmap to TIFF file (win32)?

What's the easiest way to save a bitmap (I have an HBITMAP handle) to a TIFF file using unmanaged Win32? It would be trivial using GDI+, but I'm limited to GDI. Thanks in advance! ...

On the fly bitmap editing in Android

I'm creating a scene for a game. There's a background which is a bitmap and player objects. I want to have the player objects to be able to "eat" away at the background with a transparent color as they move around the board. Basically if an object is at a certain point a circle around that object is alpha'ed out of the bitmap. The edits...

How to get a Windows Forms panel as a bitmap with C#?

I have a Windows form with a panel with several controls on it. The panel does not take up all of the form space, but only a small part. What I want to know is if there is some way to retrieve the display of the panel (with all child controls) as a bitmap. Like a screenshot but only cropped to the panel. I am not looking into the screen...

Flex/Actionscript - capturing canvas bitmap with dynamically placed elements.

I'm attempting to find overlap between elements on a flex canvas, an adaptation of http://www.gskinner.com/blog/archives/2005/08/flash_8_shape_b.html The attempt here is to place some text and figure overlap with previously placed text. The simple example below illustrates the problem. Both ImageSnapshot.captureBitmapData(canvas); o...

Android - How to change grey background created by a BitmapDrawable

I'm using the follow code, to create a non-scaled, centred image as a background, in a relative layout:- RelativeLayout explosionlayout = (RelativeLayout) findViewById (R.id.explosionlayout); explosionlayout.setBackgroundColor(R.color.white); Bitmap myBitmap = BitmapFactory.decodeResource(this.getResources(), R.drawable.bomb); Bitm...