Creating a bitmap programmatically

G

Guest

I want plot points on a cartesian surface with single pixels. I have been
unable to find a graphics member which draws points. (Is there one?)

I would like to create a bitmap one element wide and one element high where
the element is black and use the drawimage method. I don't want to read the
bitmap from a file. Is there a way to create this bitmap programmaticaly?
 
K

Ken Tucker [MVP]

Hi,

Use the graphics class fillellipse method with the width and height
= 1

Ken
-------------

I want plot points on a cartesian surface with single pixels. I have been
unable to find a graphics member which draws points. (Is there one?)

I would like to create a bitmap one element wide and one element high where
the element is black and use the drawimage method. I don't want to read the
bitmap from a file. Is there a way to create this bitmap programmaticaly?
 
L

Larry Serflaten

mark said:
I want plot points on a cartesian surface with single pixels. I have been
unable to find a graphics member which draws points. (Is there one?)

See Bitmap.GetPixel Bitmap.SetPixel
I would like to create a bitmap one element wide and one element high where
the element is black and use the drawimage method. I don't want to read the
bitmap from a file. Is there a way to create this bitmap programmaticaly?


Dim Pixel As Bitmap = New Bitmap(1,1)
Dim grx As Graphics = Graphics.FromImage(Pixel)
grx.Clear(Color.Black)
grx.Dispose

I am not sure what you wanted to use the DrawImage routine for....


HTH
LFS
 

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