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

SetPixel and colors

Somebody can explain me why if I put a color with SetPixel the color showed
is of another value? For example: I've to draw a grayscale image. The color
RGB(90,90,90) become RGB(40,45,60). In the Visual C++ 6 help I see:

Return Values
If the function succeeds, the return value is the RGB value that the
function sets the pixel to. This value may differ from the color specified by
crColor; that happens when an exact match for the specified color cannot be
found.

This happen when I set my diplay number of colors as 65.000: If I set the
display numbers of colors at 16000000 the colors I put with setPixel are
really diplayed on the screen. But I'm thinking: all the colors I want to
draw with SetPixel are out of range?? Yes. becouse all the colors are wrong
after SetPixel.

I want to copy a picture on the screen. I open the original picture with
Paint Shop Pro and all the colors are ok. I copy the screen with the "Print
Screen" button and copy it in PSP. All the color matchs the original. If I
reply the image with SetPixel, copy with "Print Screen" and put it in PSP the
colors are very diffents than originals.

WHY. This is not the first time I use SetPixel.

Tahnk you.
Nov 17 '05 #1
2 2240
"mark" <ma**@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Somebody can explain me why if I put a color with SetPixel the color
showed
is of another value? For example: I've to draw a grayscale image. The
color
RGB(90,90,90) become RGB(40,45,60). In the Visual C++ 6 help I see:


If no one resonds with better advice here you can post again in the graphics
group

microsoft.public.win32.programmer.gdi

Regards,
Will
Nov 17 '05 #2
"mark" <ma**@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
Somebody can explain me why if I put a color with SetPixel the color
showed
is of another value? For example: I've to draw a grayscale image. The
color
RGB(90,90,90) become RGB(40,45,60). In the Visual C++ 6 help I see:


If no one resonds with better advice here you can post again in the graphics
group

microsoft.public.win32.programmer.gdi

Regards,
Will
Nov 17 '05 #3

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

Similar topics

2
by: timeash | last post by:
The code below subtracts two images from one another and determines if there is any new things in the picture. A large enough color change will "register" a pixel. The pixel is then plotted using...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
1
by: Peter | last post by:
Hi, I found the SetPixel performance is very poor. it took lots of time to twist dots for a large image. I wonder if there is any other way to speed it up. Thanks. Peter ...
3
by: halise | last post by:
Hi, i am in trouble with an exception in .net platform with c#. The exception thrown is exactly as follows: System.ArgumentException: Invalid parameter used. at...
0
by: mark | last post by:
Somebody can explain me why if I put a color with SetPixel the color showed is of another value? For example: I've to draw a grayscale image. The color RGB(90,90,90) become RGB(40,45,60). In the...
2
by: Matthew | last post by:
I have put the following in my Form1_Load event: Dim Img As Bitmap = New Bitmap(1, 1) Img.SetPixel(0, 0, Color.Green) BackgroundImage = Img TransparencyKey = Img.GetPixel(0, 0) This makes...
3
by: Atmapuri | last post by:
Hi! I was profiling a drawing applicationa and Bitmap.SetPixel is consuming 90% of all CPU. Is there an alternative way to create the bitmap and fill it with data that is stored in an array of...
1
by: tamasumalta | last post by:
I would like to change some pixels inside a particular gif file. I tried using the setpixel and noticed that it is not compatible with indexed images. Then I converted the file from a gif to a bmp...
0
by: Anil Gupte | last post by:
I am using an Image Button from Microsoft's Power Pack. When I use the ..Enabled=True/False I get the following error "SetPixel is not supported for images with indexed pixel formats" I am...
3
by: Seabass | last post by:
Hello everyone, I have to do an image viewer for an exotic format so I want to know how to place pixels somewhere on the form or on some object. I tried doing this but it works incredibly...
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: 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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.