bitmap

How to render to offscreen bitmap then blit to screen using Core Graphics

I would like to render to an offscreen bitmap (or array of RGBA values) and then blit those to a UIView during in the view's drawRect function. I would prefer to do full 32-bit rendering (including alpha channel), but would also be content with 24-bit rendering. Would anyone mind pointing me in the right direction with some code snippet...

Filtering away nearby points from a list

I half-answered a question about finding clusters of mass in a bitmap. I say half-answered because I left it in a condition where I had all the points in the bitmap sorted by mass and left it to the reader to filter the list removing points from the same cluster. Then when thinking about that step I found that the solution didn't jump ...

How to add padding bytes to a bitmap?

Lets say I have some raster data I want to write to a file.. Now I want to write it as a bmp file.. This data happens to be not DWORD aligned, which, if I understand correctly, needs to be padded with enough bytes to reach the next DWORD.. However, when I try to pad it with this code: bmFile.Write(0x0, (4-(actualWidth%4))); I get an...

accessing image data from a bitmap given a pointer (on the iphone)

my problem is reading the pixel data correctly once i have the pointer so i have an image that takes up the whole iphone screen that has no alpha channel (24 bits per pixel, 8 bits per component, 960 bytes per row) and i want to find out the color of a pixel at a particular XY coordinate. i have the pointer to the data UInt8 *data = C...

Tools for creating text as bitmaps (anti-aliased text, custom spacing, transparent background)

I need to batch create images with text. Requirements: arbitrary size of bitmap PNG format transparent background black text anti-aliased against transparency adjustable character spacing adjustable text position (x and y coordinates where text begins) TrueType and/or Type1 support Unix command line tool or Python library So far I've...

Generate image file with low bit depths?

bpp = bits per pixel, so 32bpp means 8/8/8/8 for R/G/B/A. Like .NET has an enum for these "System.Drawing.Imaging.PixelFormat". Now once I have a Bitmap or Image object with my graphics, how would I save it to a file / what format would I use? What image file format (JPEG/GIF/PNG) supports low bit-depths like 16bpp or 8bpp (instead of...

c# GDI Edge Whitespace Detection Algorithm

I am looking for a solution for detecting edge whitespace of c# bitmap, from the c# managed GDI+ library. The images would be either transparent or white, most of the 400x pictures are 8000x8000px with about 2000px whitespace around the edges. What would be the most efficient way of finding out the edges, x, y, height and width coord...

serialize a bitmap within a custom object

I've got a valuetype object that I'm trying to serialize (via a BinaryFormatter) but within this object there are 3 Bitmaps which, when serializing the object throw a "general gdi+ exception" (no seriously, that's the exception). It's imperative that these bitmaps get serialized into the file (as opposed to just storing their relative ...

WPF PresentationSource.FromVisual Element within Style

I have custom Bitmap object that is within a styled button. I am trying to call PresentationSource.FromVisual within the Bitmap object however it is returning null. How would I get the Parent element (in this case a Button) from within the child Bitmap object. Is there standard code to get the styled parent? For example the WPF style...

How to merge tiff images with Delphi?

I have 4 small tiff images and I would like to generate a big one by merging the 4 single one. Does anyone know how to do it directly with Delphi or some good component that could do it? ...

Can't use ImageSnapshot.captureBitmapData with a rotation matrix

Does anyone have an example of using the ImageSnapshot.captureBitmapData function with a rotation matrix? This is the code I'm using: var matrix:Matrix = new Matrix(); matrix.rotate(degreesToRadians(90)); var bitmapData:BitmapData = ImageSnapshot.captureBitmapData(textInput, matrix); But unfortunately this throws an error on the follo...

Render FixedPage contents onto bitmap

I have the following code, taken from http://www.codeplex.com/XPS2Image/ ,which in turn was taken from some people discussing at at Microsoft development forums. int[] pages = new int[] { 0, 1, 2, 3, 4 }; XpsDocument xpsDoc = new XpsDocument(@"c:\tmp\sample.xps", System.IO.FileAccess.Read); FixedDocumentSequence docS...

What libraries are available for manipulating super large images in .Net

I have some really large files for example 320 MB tif file with 14000 X 9000 pixels. The operations I need to perform are basically scaling the images to get smaller versions of it and breaking the image into tiles. My code works fine with small files and I use the .Net Bitmap objects but I will occasionally get Out of Memory exception...

Load a BitmapSource and save using the same name in WPF -> IOException

When I try to save a BitmapSource that I loaded earlier, a System.IO.IOException is thrown stating another process is accessing that file and the filestream cannot be opened. If I only save whithout loading earlier, everything works fine. The loading code: BitmapImage image = new BitmapImage(); image.BeginInit(); image.UriSource = ur...

How can i get a BitmapData object out of a File object from a local jpeg file in AIR?

So I am trying to create an image gallery. My AIR application accepts files that are dragged and dropped onto a TileList component. I am using the images as icons but the problem is that they take a long time to load so i want to compress the file data first (I have that part done) The problem is that I can't figure out how to open the f...

Papervision Render to Bitmap

Does anyone know of a way to render a 3D scene to a bitmap using the Papervision renderer? I would like to take a freeze-frame of my scene that I can display while I change the scene in the background. ...

Flash/ActionScript: Draw a display object "onto" another

How do I properly draw one vector object onto a specific position of another in ActionScript, accounting for positioning, transparency, etc? My idea (as suggested e.g. here) was to use beginBitmapFill() and drawRect() to draw a bitmap copy (made using BitmapData.draw()) of one MovieClip onto the .graphics property of the other MovieClip...

How to pull out the ARGB component from BitmapContext on iPhone?

I'm trying to get ARGB components from CGBitmapContext with the following codes: -(id) initWithImage: (UIImage*) image //create BitmapContext with UIImage and use 'pixelData' as the pointer { CGContextRef context = NULL; CGColorSpaceRef colorSpace; int bitmapByteCount; int bitmapBytesPe...

How to read CGBitmapContextData? (on iPhone)

I'm working on obtaining bitmap data like ARGB from an image. a). I create a bitmapcontext for the image: context = CGBitmapContextCreate(void * data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef colorspace, CGBitmapInfo bitmapInfo) b). I draw the image to the context: CGContextDrawImage...

How do I use large bitmaps in .NET?

Hello! I'm trying to write a light-weight image viewing application. However, there are system memory limitations with .NET. When trying to load large bitmaps (9000 x 9000 px or larger, 24-bit), I get a System.OutOfMemoryException. This is on a Windows 2000 PC with 2GB of RAM (of which 1.3GB is used up). It also takes a lot of time to ...