473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

making a bitmap file from arrays

I have the colormap (ARGB, 8bit , so every color from 0 to 255) , put it in
an array (1dim)

I have the pixel date (array 640x480)

What is the best way to make with these array's a bitmap file?

Thx
Jeroen
Nov 15 '05 #1
5 2534
Jeroen,

Can you clarify your question? Are you trying to create a .bmp file or a
file in any other standardized bitmap graphics file format or are you simply
looking for a way of storing your array (the raw pixel data) in a file?

Regards,
Alex

"Jeroen Ceuppens" <Je*************@barco.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
I have the colormap (ARGB, 8bit , so every color from 0 to 255) , put it in an array (1dim)

I have the pixel date (array 640x480)

What is the best way to make with these array's a bitmap file?

Thx
Jeroen

Nov 15 '05 #2
Hi,

All you have to know is the format a BMP file is organized, after that you
can create your own file with an .bmp extension and write your data
according the format using a FileStream object.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Jeroen Ceuppens" <Je*************@barco.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
I have the colormap (ARGB, 8bit , so every color from 0 to 255) , put it in an array (1dim)

I have the pixel date (array 640x480)

What is the best way to make with these array's a bitmap file?

Thx
Jeroen

Nov 15 '05 #3
Here's a quick link of how to create a bitmap programmatically. You'll have
to piece together how you're arrays fit into the SetPixel methods...
http://msdn.microsoft.com/library/de...ridvisualc.asp

Having said that, I'll mention that SetPixel is very slow (well, when
looping 4 million times it is, not sure for 300,000 times to make a 640x480
bitmap). I suggest using unsafe code, i.e. pointers. This site has a very
good description of how to set pixels by using pointers. I would get your
code working according to the above link, then if you need the speed
optimize it as follows:

http://www.codeproject.com/cs/media/...cfilters11.asp

--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com
"Jeroen Ceuppens" <Je*************@barco.com> wrote in message
news:ux**************@TK2MSFTNGP09.phx.gbl...
I have the colormap (ARGB, 8bit , so every color from 0 to 255) , put it in an array (1dim)

I have the pixel date (array 640x480)

What is the best way to make with these array's a bitmap file?

Thx
Jeroen

Nov 15 '05 #4
I think Michael intended this link: http://tinyurl.com/mtx5.

Michael Roper
Nov 15 '05 #5
"Michael Roper" <mi******@encraft.com> wrote in message
news:bj************@ID-160215.news.uni-berlin.de...
I think Michael intended this link: http://tinyurl.com/mtx5.

most certainly true...
Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Gandalf | last post by:
Hi Gurus! Here is a problem with wxPython. I would like to load bitmaps and create a mask for them at once. Here is my idea: the mask colour for the bitmap should be the colour of the pixel in...
2
by: Sharon | last post by:
I encountered a strange behavior when doing ‘new Bitmap’: The following code works fine and the given bitmap file is shown on the PictureBox (the m_DrawArea) in the correct bitmap sizes: ...
2
by: Jax | last post by:
So far i've not had much luck with this method. Bitmap.MakeTransparent(someColor); Makes the transparent colour either a non-transparent black (.bmp, jpg or .gif) or silver (.png) i've tried...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
4
by: Nikhil | last post by:
Hi, I am trying to write a program, which will let me arrange 5 5x7 images into an A3 sheet(12x18), 600 dpi. I have a 3Ghz 512MB RAM machine. Basically, I make a 7200 by 10800 pixel (12x18)...
4
by: ShieldsJared | last post by:
Im looking for help making a good GUI out of pure images. I would like to embed the common controls and such, but I want to make a nice looking GUI, similar to that of, say Windows Media Player. ...
2
by: Marco Biagioni | last post by:
After i've tried to update a vb 6.0 project to vb.net, using visual studio utility,i can't read correctly data bytes from a .bmp file to insert them in a matrix to operate on. Using vb 6.0 the...
7
by: RB0135 | last post by:
Hi All, I have some Windows BMP, 1BPP, monochrome files that I need to get the raw data from to load a graphics buffer on a Roll Printer (which I know can be done). Lets forget about the Roll...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.