473,394 Members | 1,887 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,394 software developers and data experts.

Easy and efficient way to get and set pixels

I was wondering if anybody knew and easy way to read pixels. Is the
easiest way to read a byte in convert it to a Bitarray and then when
finished convert it back to Byte......I am looking in my monochrome
bitmap file now at the minute.....if a value is false then the pixel is
turned off and therefore its white......but this does not seem to be
true.....could anyone explain how exactly to use this bitarray.....i
have a monochrome bitmap file read in....it says the first byte reads
:false true false etc (01000010) which is "66" in decimal.......i am
looking at the screen and the position and its clearly meant to be white
whats wrong.....anybody know?........marcian u answered my questions
before maybe u know......and thanks to u too.....
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 2342
Hi James,
I was wondering if anybody knew and easy way to read pixels. Is the
easiest way to read a byte in convert it to a Bitarray and then when
finished convert it back to Byte......I am looking in my monochrome
bitmap file now at the minute.....if a value is false then the pixel is
turned off and therefore its white......but this does not seem to be
true.....could anyone explain how exactly to use this bitarray.....i
have a monochrome bitmap file read in....it says the first byte reads
:false true false etc (01000010) which is "66" in decimal.......i am
looking at the screen and the position and its clearly meant to be white
whats wrong.....anybody know?........marcian u answered my questions
before maybe u know......and thanks to u too.....


I had wiritten some "fast" c# image processing classes... but
they have been working with 24bpp precission. So i don't
have any practise with other pixel formats.

Only thing i can recommad to You is to try using method:
Bitmap.LockBits(
Rectangle rect,
ImageLockMode flags,
PixelFormat format
);

It returns BitmapData with Scan0 property which returns
memory address of first byte of bitmap data.
....but from here becomes "UNSAFE" mode with pointers.

If You've got any experience in C/C++ programing then
You should menage with this.

But, If You want to work with files and streams then
make sure to get those files specification (if they
have any compression or particular byte direction?)
Good thing is to start with small files e.g. 16x16.

Usually if there's no compression, image data lies
at the end part of file. So if you know its size then
you can easily gets its bytes.

Cheers!

Marcin

Nov 16 '05 #2

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

Similar topics

3
by: Oliver Bryant | last post by:
I just finished developing a javascipt component allowing floating captions to appear over HTML elements. If anyone wants to check it out you can see specs and download it from...
36
by: No Spam | last post by:
Dear fellow Access 2003 Users, Is there a way to trim all of the fields in a table in one swoop using VBA (preferred) or a query? Right now, I am using an update query and updating EACH field...
6
by: Craig Parsons | last post by:
Folks, I have an image of a circle, which I am trying to straighten out into a flat line. I am essentially wanting to look at the image, and read a straight line from the centre, and then plot...
4
by: Ma Xiaoguang | last post by:
Dear ladies and gentlemen: How to access all the pixels of a bitmap with C#? I am working with Delphi before. In Delphi, you can use TBitmap.Scanline property to access all the pixels of a...
2
by: keith | last post by:
The function return quite rough pixels. e.g. if you use Font: Verdana, Font style:Regular, Size:8 and type 60 upper case character C, the functuion returns pixels 478.3639, but actualy it...
12
by: Laphan | last post by:
Hi All Strange question this, but could somebody tell me what the old size=1, size=2 .... to size=7 font parameters are in pixels and points. I thought it was: size 1 = 7 pt size 2 = 14...
4
by: samadams_2006 | last post by:
Hello, There are various "Color Pickers" out there, where a series of colors are displayed on a grid and when the user clicks one of these colors, it is selected, and processed by the...
3
by: headware | last post by:
I have to create some vertical text for a web page that allows users to print to labels. We decided to do this by creating an <imgtag on the web page and having the src attribute point to another...
3
by: defn noob | last post by:
i want to process a large number of images and store their respective pixels in a matrix. what is the mostt efficient way of opening and checking them? i doubt pygame is made for this purpose :)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.