How to draw graphics on a bitmap ?

O

Oberfuhrer

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 ?
 
H

Homer J Simpson

Oberfuhrer said:
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 ?

There are many ways to do that. One is to link in a chart tool from, say,
Excel and use that. Or you can draw directly onto a PictureBox which I have
done to emulate a plotter. There are graphics primitives in the system.
 
C

Cor Ligthert [MVP]

Herfried,
"Oberfuhrer" <[email protected]> schrieb:

You answer questions from people with this kind of nicks? If it was from
Germany, Swiss or Austria, I even could understand it because I do not know
if it is used by instance at the scouts.

In this case it is somebody from Norway and therefore it can only mean
something as this, what is my only result in Wikepedia.

http://en.wikipedia.org/wiki/Oberführer

Let us keep this newsgroup free from politics or things that can hurt
people.

Just my opinion.

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
You answer questions from people with this kind of nicks? If it was from
Germany, Swiss or Austria, I even could understand it because I do not
know if it is used by instance at the scouts.

What if this is the person's last name?
 
H

Homer J Simpson

Cor Ligthert said:
Herfried,


You answer questions from people with this kind of nicks? If it was from
Germany, Swiss or Austria, I even could understand it because I do not
know if it is used by instance at the scouts.

You don't REALLY think I am Homer J Simpson do you??
 
B

Bob Powell [MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top