[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Can I make a greyscale Graphics object

Teis Draiby

1/6/2005 1:18:00 AM

I am working on a painting program for painting height maps. I want the
height information to be a 8 bit greyscale value. When I use the
Graphics.FromImage() method it seems that I can only create Graphics objects
from color bitmaps, not indexed/greyscale bitmaps.

Can Graphics objects only be in color then??

thanks in advance, Teis


2 Answers

Bob Powell

1/6/2005 9:53:00 AM

0

Graphics objects can only be created for the screen, printer or non-indexed
pixel format images. You can load the grayscale image, draw it to a colour
image and then draw on that but you'll have to convert back to 8 bit indexed
grayscale if you want to save the information again.

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

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Teis Draiby" <teisREMOVE-THIS@draiby.com> wrote in message
news:OCikK248EHA.1404@TK2MSFTNGP11.phx.gbl...
>I am working on a painting program for painting height maps. I want the
> height information to be a 8 bit greyscale value. When I use the
> Graphics.FromImage() method it seems that I can only create Graphics
> objects
> from color bitmaps, not indexed/greyscale bitmaps.
>
> Can Graphics objects only be in color then??
>
> thanks in advance, Teis
>
>


Teis Draiby

1/6/2005 4:01:00 PM

0

Thank you. You'll be put on the acknowledgements list.
regards, teis

"Bob Powell [MVP]" wrote:
> Graphics objects can only be created for the screen, printer or
non-indexed
> pixel format images. You can load the grayscale image, draw it to a colour
> image and then draw on that but you'll have to convert back to 8 bit
indexed
> grayscale if you want to save the information again.