Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > How to cahnge pixel value with gray scale image?

Reply
Thread Tools

How to cahnge pixel value with gray scale image?

 
 
Dev S Shrestha
Guest
Posts: n/a
 
      11-11-2003
I created a grayscale image

Bitmap img(320,240,PixelFormat8bppIndexed);

I want to set the BYTE values to each of the pixels using

img.SetPixel(x,y,v);

where v is a BYTE value between 0 and 255
It did not work.

Any solution?


 
Reply With Quote
 
 
 
 
Thomas Matthews
Guest
Posts: n/a
 
      11-11-2003
Dev S Shrestha wrote:

> I created a grayscale image
>
> Bitmap img(320,240,PixelFormat8bppIndexed);
>
> I want to set the BYTE values to each of the pixels using
>
> img.SetPixel(x,y,v);
>
> where v is a BYTE value between 0 and 255
> It did not work.
>
> Any solution?
>
>


Yes, please post the smallest amount of compilable code
that demonstrates your issue. Please state the expected
behavior as well as the actual behavior. Do not attach
the code, just past it into your posting.

Please read the FAQ and Welcome.Txt below for instructions
on how to post.

One reason that your call:
img.SetPixel(x,y,v);
did not 'work' is because x, or y may be out of range.
There may be many other reasons too, but since you did
not post any code, the world will never know.

By the way, the C++ language does not have facilities
for bitmaps and pixels. You need to ask the experts
in a newsgroup about your compiler or platform. There
are many listed in the C++ FAQ and Welcome.TXT listed
below.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Logging using application blocks- Cahnge the log file @ run time kavitha ASP .Net 0 01-16-2009 07:16 AM
selectindexchanged event doesn't fire after I cahnge my datasource =?Utf-8?B?QnJpYW4=?= ASP .Net 0 10-05-2007 05:09 PM
how to cahnge delimiter in Mysql from a java program Sarath Java 1 10-26-2006 12:35 AM
The Definitive Chord & Scale Bible - Literally EVERY chord and scale! Kind of Blue2 Digital Photography 1 02-08-2005 10:14 PM



Advertisments