The GDI+ FAQ has the answer to this question..
There is a caveat however...
You cannot draw directly onto a bitmap having an indexed pixel format. They
will throw an exception. These include some of the TIFF formats and GIF.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Oberfuhrer" <he*******@yahoo.no> wrote in message
news:kY********************@telenor.com...
I am an old mathematician, who in my sparetime work on a topic oriented
math application.
I have converted from old, dry Fortran to the more intuitive and juicy
VB.net and Windows.
In particular i would like to have options to draw graphics straight to a
bitmap object.
A typical example would be to save a plot of a function y=f(x) drawn on a
control.
To figure out where to set individual pixels for lines and fonts may be
possible after some struggle,
but maybe there is a better approach around? Is it possible to get a
graphics object for a bitmap ?