In GDI+, the BitmapData class is used by the Bitmap::LockBits and Bitmap::UnlockBits methods of the Bitmap class. A BitmapData object stores attributes of a bitmap.
Questions tagged [bitmapdata]
404 questions
40
votes
4 answers
Create Bitmap from a byte array of pixel data
This question is about how to read/write, allocate and manage the pixel data of a Bitmap.
Here is an example of how to allocate a byte array (managed memory) for pixel data and creating a Bitmap using it:
Size size = new Size(800, 600);
PixelFormat…
Pedro77
- 4,773
- 7
- 50
- 82
37
votes
3 answers
How many ways to convert bitmap to string and vice-versa?
In my application i want to send bitmap image to the server in the form of string, i want to know how many ways are available to convert a bitmap to string. now i am using Base64 format for encoding and decoding, it takes little bit more memory. is…
RajaReddy PolamReddy
- 21,702
- 18
- 110
- 161
36
votes
6 answers
What is the best way to resize a BitmapData object?
Say I have a BitmapData of 600x600 and I want to scale it down to 100x100.
Iain
- 9,138
- 9
- 43
- 63
28
votes
3 answers
PixelFormat.Format32bppArgb seems to have wrong byte order
I try to get all byte values from a Bitmap(System.Drawing.Bitmap). Therefore I lock the bytes and copy them:
public static byte[] GetPixels(Bitmap bitmap){
if(bitmap-PixelFormat.Equals(PixelFormat.Format32.bppArgb)){
var argbData = new…
0xBADF00D
- 890
- 1
- 11
- 23
16
votes
5 answers
How do you load a bitmap file into a BitmapData object?
In Flash, the BitmapData object can be used to store bitmaps in RAM, you can later draw them to a MovieClip using the beginBitmapFill() method.
How do you load an external bitmap file (.jpg) into a BitmapData object?
Even AS3 code would be helpful.
Robin Rodricks
- 99,791
- 133
- 372
- 575
6
votes
1 answer
Invalid BitmapData randomness
I started converting this flex application to run on android using the new flex hero sdk.
I already replaced all mobile-incompatible components and got it running a few times succesfully.
When I use the same libraries running the original…
vegasaurus
- 180
- 7
6
votes
2 answers
ByteArray to BitmapData AS3
I'm using com.adobe.images.PNGEncoder to encode bitmapData to a byteArray. Is there a way to convert the byteArray back to bitmapData NOT using a Loader? thanks.
EDIT: the reason i don't want to use a Loader is it being Asynchronous, and I don't…
astralmaster
- 1,992
- 11
- 45
- 76
5
votes
1 answer
URLLoader data to BitmapData
I'm trying to load an image file that's right next to the .SWF file. Something like this:
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, function(e:Event):void {
…
John Crichton
- 77
- 1
- 1
- 6
5
votes
2 answers
C# BitmapData class Scan0 and Stride properties meaning
Can anyone explain what Scan0 and Stride properties of BitmapData class in C# are for?
joonshen
- 149
- 1
- 4
- 14
5
votes
3 answers
Efficient execution of boolean expression on bitmap in C or C++
What is the most efficient way of executing a boolean expression on a bitmap in C or C++? For example, let's say that I have a 4-bit bitmap (a, b, c, d). Now, let's say that I have a simple boolean expression like (a AND b) OR (c AND d). How should…
Ismael Ghalimi
- 3,358
- 2
- 19
- 23
5
votes
7 answers
AS3:How to change a colored Bitmap's BitmapData to black and white?
How can I change the bitmapdata of a coloured Bitmap to Black and White in AS3 ?
I'm developing a simple image editor tool for a CMS in flash.
People should be able to switch the colour of the uploaded Bitmap to black and white. I want the…
Yens
- 845
- 4
- 11
- 24
5
votes
2 answers
AS3 - Scale BitmapData
I'd like to scale a BitmapData to different sizes such as 200, 400, 600 and 800.
What is a good way to do that?
Tom
- 4,069
- 12
- 57
- 101
5
votes
1 answer
AS3 / AIR / Mobile - Save bitmap to file
I have seriously looked everywhere but can't find a solution.
My app easily saves UTF bytes as XML files in the allowed cache locations for both iOS and Android.
But I can't work out how to save Bitmap / BitmapData to a file in the same cache…
atomicDroid
- 87
- 2
- 9
4
votes
3 answers
What is BitmapData.reserved?
BitmapData has a property called Reserved, which returns a 32-bit signed integer. Microsoft's documentation says not to use this property. If we shouldn't use it; then why is it there? What exactly is it for?
bbosak
- 5,073
- 7
- 37
- 57
4
votes
2 answers
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()…
user372950
- 43
- 1
- 4