Re: Drawing Pixels
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 27 Jan 2006 08:49:42 -0500
Hi Chris,
Your original question was regarding setting the pixels of the "client area
of a window." This is different than drawing on a bitmap, which is not a
window, nor the client area of a window.
Most drawing is not done using the few methods available in the
System.Drawing.Bitmap class, such as the SetPixel method. In fact, most
drawing done on Bitmaps is done via the Graphics class. I would suggest you
read up on it.
I think you would also benefit from the articles and tutorials at
http://www.bobpowell.net/.
The particular problem you seem to be describing is that you want the Bitmap
to appear immediately after you perform some drawing operation. If you could
be more specific about your business requirement, I could probably be of
more help. In the meantime, if you visit the references I mentioned, you may
not need any help.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.
"Chris Saunders" <evas@xxxxxxxxxxxxxxxxx> wrote in message
news:13a29$43d951c2$18d55654$15845@xxxxxxxxxxxxxxxxxxxx
> Thanks for the reply Kevin.
>
> That class was the first place I looked but it does not appear
> to provide for setting a pixel individually and having it appear
> immediatly on the screen. So far all I have managed was to
> use a System.Windows.Forms.PictureBox and a
> System.Drawing.Bitmap, I use SetPixel for the
> bitmap and then set the pictureBox.Image to the
> bitmap. Even if I do pictureBox.Image = bitmap in
> every iteration of the loop where I set the bitmap
> pixels the redrawing does not appear until the loop
> is finished.
>
> I hope this explanation was clear enough.
> Still hoping for a solution.
>
> Regards
> Chris Saunders
>
> "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:eFrEZkoIGHA.528@xxxxxxxxxxxxxxxxxxxxxxx
>> Check out the System.Drawing.Graphics class:
>>
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdrawinggraphicsclasstopic.asp
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> .Net Developer
>> Who is Mighty Abbott?
>> A twin turret scalawag.
>>
>> "Chris Saunders" <evas@xxxxxxxxxxxxxxxxx> wrote in message
>> news:4a9ac$43d87b05$18d55654$25861@xxxxxxxxxxxxxxxxxxxx
>>>I am fairly new to .Net and C# but am familiar with the Win32 API.
>>> I wish to set the pixels of the client area of a window one at a time
>>> with a specific color. I have so far discovered that
>>> System.Drawing.Bitmap
>>> has a SetPixel() method but I can't seem to find out how to have the
>>> bitmap
>>> displayed. I would actually like to have the pixels appear as I set
>>> them.
>>>
>>> Regards
>>> Chris Saunders
>>>
>>
>>
>
>
.
- References:
- Drawing Pixels
- From: Chris Saunders
- Re: Drawing Pixels
- From: Kevin Spencer
- Re: Drawing Pixels
- From: Chris Saunders
- Drawing Pixels
- Prev by Date: Re: interesting task for .NET learners: why ArrayList.Sort hangs? [.NET 1.1]
- Next by Date: Re: Foreach with controls
- Previous by thread: Re: Drawing Pixels
- Next by thread: UML class diagram using reflection- Com component
- Index(es):
Relevant Pages
|