472,368 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,368 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 2160
"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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.