473,326 Members | 2,099 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,326 software developers and data experts.

4bpp bit setting problem

I set the first 4 index values of the colorpalette to the following:
0 = white;
1 = red;
2 = blue;
3 = OverlapColor(mix of red and blue);

So the first 4 bits will be used to to set one pixel.....so if i want to
set it to red for instance i set the byte to a value of 1..........if i
want to set the following pixel to red also i add the value 16 to the
byte so two pixels side by side will have a byte value of 17.....4bits
for each pixel.....first 4 bits is 1 second is 16......
Unfortunately this does not work for some reason..could somebody please
tell me how to set each 4bit pixel to get the correct value....i seem to
be able to set the first 4 bits allright but not the second 4 bits.....
is first 4 bits
0,1,2,4,8 then second 4 bits are 16,32,64 and 128......but which bits do
i turn on?....
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 1653
Look at the LockBits article on the GDI+ FAQ. It has details on how to
access the bit arrays for various formats.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"James Dean" <m_*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I set the first 4 index values of the colorpalette to the following:
0 = white;
1 = red;
2 = blue;
3 = OverlapColor(mix of red and blue);

So the first 4 bits will be used to to set one pixel.....so if i want to
set it to red for instance i set the byte to a value of 1..........if i
want to set the following pixel to red also i add the value 16 to the
byte so two pixels side by side will have a byte value of 17.....4bits
for each pixel.....first 4 bits is 1 second is 16......
Unfortunately this does not work for some reason..could somebody please
tell me how to set each 4bit pixel to get the correct value....i seem to
be able to set the first 4 bits allright but not the second 4 bits.....
is first 4 bits
0,1,2,4,8 then second 4 bits are 16,32,64 and 128......but which bits do
i turn on?....
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

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

Similar topics

18
by: fleemo17 | last post by:
My organization is developing a set of "standards" for websites built inhouse. The first question that comes to mind is what would be a good standard default size for <p> text? 12 point? Which...
0
by: Rhino | last post by:
I am working with SQL Functions in DB2 for Windows/Linux/UNIX (V8.2.1) and am having a problem setting input parameters for SQL Functions to null in the Development Center. My simple function,...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
0
by: Shravan | last post by:
Hi, I am setting a row value in my grid using ((DataRowView)grid.ListManager) = value; if the given rowNo is not the current position in the currencymanager, setting some value in the row is...
8
by: David Lozzi | last post by:
Howdy, I have a user control that is a report to display data. On the page the control is inserted in, I have filter options to filter the report. When I try to do something like this, nothing...
14
by: Roger Withnell | last post by:
How to I find out what size text the browser is set to? Thanks in anticipation.
0
by: news.microsoft.com | last post by:
Hi guys, This text looks long and complicate but it is not, and I really really need some help here. For the last 24hs I'm trying to resolve this issue (last night I dreamed
4
by: Blackbrand | last post by:
I'll start off with what i'm trying to do: i want to search my data programmatically and then jump to the row in the datagrid. My data will almost allways go out of the datagrids bounds so if the...
0
by: Lyn | last post by:
I have a problem using the form .Filter and .FilterOn properties which causes Access to crash (as detailed in a separate post). The form operates in continuous mode, displaying matching records...
3
by: Dreea | last post by:
Hello i have a .netapplication that runs with no problem when launched from the local machine, but when i try to run the same executable from the network the applications doesn't start. I suppose...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.