bitmap

Writing to a 8 bit grayscale image in C#

Hi, I am building an application in C# and .NET 2.0 which takes an 8 bit grayscale image as input, does some operation on the pixel values and writes back to the image. When I write the pixel values back to the bitmap, the image is being displayed in color. Please help me fix this problem. Thanks, Rakesh. ...

Bitmaps in Android

I have a few questions regarding Bitmap objects and memory and their general taxonomy. What is an in-memory or native bitmap? How is Bitmap memory different from Heap memory? ...

Creating a bitmap file line by line

Hi, Is it possible to write a bitmap in C# line by line? I am worried that using the Bitmap.Save() function will require too much memory when dealing with LARGE files.. To clarify, I want to do this: Open the file and write the bitmap header (if any) Put 1 scanline worth of image data into a buffer (byte[]) Write the contents of the ...

Adding a object to a bitMapData

As of right now. I have 3 objects. One BitMap that acts as my canvas. And 2 bitmapDatas. One is my buffer and another is my tiles. I am creating a tiling effect for a game. I would like to take my tile:BitMapData, and turn it into a custom object. reason being is I want each tile to be interactive. So I can click on each one. Is it possi...

Reading and parsing the width/height property of a bitmap

I'm trying to write a bitmap (.bmp) parser/reader by reading raw bytes from the file and simply checking their values, and I've come across something I simply cannot wrap my mind around. The image I'm trying to read is 512x512 pixels, and when I look at the width property (at 0x12 and 4 bytes onward) it says 00 02 00 00 (when viewed in ...

Is graphic object bitMapData type the same as bitmapData type ??

The title might be a little misleading. Look at my code and I will explain public static function loadTile(tileDir:String = "empty"):void { if(tileDir != "empty") { tPoint = new Point(0,0); tRect = new Rectangle(0,0,30,30); //load in tile sheet image ...

How to copy bitmap to clipboard using the win32 API?

How do I copy a buffer that would save to a ".BMP" file to the clipboard using the win32 API? I.e., I have a raw buffer of a Windows V3 Bitmap (including the header) that I can literally write() to a file and will result in a valid .BMP file, but I want to copy it to the clipboard instead. On OS X, in plain C, the code would look someth...

certain BitMapData types dont work in a beginBitmapFill() method.

Say I loaded a bitMap into a bitmapData type called tileImage. tileImage = Bitmap(loader.content).bitmapData; say I decided to add that bitmap into a sprite like below this.graphics.beginBitmapFill(tileImage ); this.graphics.drawRect(0, 0,tWidth ,tHeight ); It would of course work. But say If I decided to add tileImage into a ano...

How do I render a view which contains Core Animation layers to a bitmap?

I am using an NSView to host several Core Animation CALayer objects. What I want to be able to do is grab a snapshot of the view's current state as a bitmap image. This is relatively simple with a normal NSView using something like this: void ClearBitmapImageRep(NSBitmapImageRep* bitmap) { unsigned char* bitmapData = [bitmap bitmap...

Changing a sprites bitmap

As of right now, I am trying to create a tiling effect for a game I am creating. I am using a tilesheet and I am loading the tiles to the sprite like so... this.graphics.beginBitmapFill(tileImage); this.graphics.drawRect(30, 0,tWidth ,tHeight ); var tileImage is the bitMapData. 30 is the Number of pixels to move retangle. then tWidth ...

Invalid BitMapdata Error #2015

private static var tileDir:String; public static var tileImage:BitmapData; private static var loader:Loader; public static var tileReady:EventDispatcher = new EventDispatcher(); public static var tileNum_perRow:Number = 3; public static var select:selector; public var tileNum:Numb...

1067: Implicit coercion of a value of type void to an unrelated type flash.geom:Matrix.

Im confused, I passed a matrix datatype into the this.graphics.beginBitmapFill(); and i get Implicit coercion of a value of type. below is my code. var theMatrix:Matrix; theMatrix = new Matrix(); this.graphics.beginBitmapFill(tileImage,theMatrix.translate(30,0)); this.graphics.endFill(); and the fol...

understanding matrix.transition(); as3

I am trying to understand the method transition that falls in the Matrix Class. I am using it to copy pieces of a bitMapData. But I need to better understand what transitions do. I have a tilesheet that has 3 images on it. all 30x30 pixels. the width of the total bitmap is 90pxs. The first tile is green, the second is brown, and the ...

#2015: Invalid BitmapData.

in my class, if I create bitmapData like this private var tImage:BitmapData; public function object():void { tImage = new BitmapData(30,30,false,0x000000); } I get the following error ArgumentError: Error #2015: Invalid BitmapData. But if I declare the varible inside the method public function object():void { var tIm...

Finding Something lighter than Sprites!!

I am making a Sim City like game. There are lots of tiles. When I first started. I was just using a tilesheet. I was copying the necessary pieaces from the tilesheet. on to a blank bitMapData. I then took the bitMapData and put it into a bitMap which I then put into a DisplayObject. It worked great! tileSheet:BitMapData <----- data i...

Extending BitMap class. will addChild() accept subClasses ??

I want to create a class that is interactive and can hold an image. I want it to be lighter then the Sprite class, so I was thinking about extending the bitMap class. If I extend the BitMap class. put a bitMap data in that class and at it to the stage. would it appear ??? ...

circular colorTransform

Is there a way to apply a colorTransform to a BitmapData in a circle rather than in a rectangle? Instead of erasing rectangular parts of an image by reducing the alpha channel as in the code below, I'd like to do it in circles. _bitmap.colorTransform(new Rectangle(mouseX-d/2, mouseY-d/2, d, d), new ColorTransform(1, 1, 1, .5, 0, 0, 0...

Bitmap to int[] using Marshal.Copy()

Hi, I'm using Marshal.Copy() to copy the pixel information from a Bitmap to an int[] array, the problem resides in the fact that the information that is coming to this array is coming all wrong, like: [0] = -8682109; [1] = -8682109; [2] = -8616573; [3] = -8616573; [4...

reverse colortransform alpha AS3

I'm fading out a Bitmap in AS3 by repeatedly applying a ColorTransform every frame to its BitmapData; _bitmap.colorTransform(_bitmap.rect, new ColorTransform(1, 1, 1, .9, 0, 0, 0, 1)); When applying the apparent reverse to fade it back in I get a discoloured image. _bitmap.colorTransform(_bitmap.rect, new ColorTransform(1, 1, 1, 1.1...

Using bitmap fonts in Netbeans

Is it possible to use bitmap (.fon) fonts in Netbeans? I have a font I particularly like (Raize font) and I don't see it anywhere on the list when I try to set it as the editor font. I can use it in other editors (Notepad++, pspad, visual c++ express etc). I can't use it in jedit either. Is this issue java related? ...