Fast Graphic Drawing

  • Thread starter Thread starter predseda
  • Start date Start date
Hi,

Create a bitmap. Create a graphics class from the bitmap. Draw on
the bitmap. Set the picturebox's image to the bitmap. Note the graphics
class does not have a drawpoint method draw a line with the same start and
stop point instead or an ellipse with a width of 1.

Dim bm As New Bitmap(100, 100)

Dim g As Graphics = Graphics.FromImage(bm)

g.DrawRectangle(Pens.Red, 0, 0, 50, 50)

g.FillEllipse(Brushes.Green, 10, 10, 50, 50)

g.DrawLine(Pens.Blue, 60, 60, 60, 60)

g.DrawEllipse(Pens.Blue, 60, 60, 1, 1)

picturebox1.image = bm

Ken
 
* (e-mail address removed)-spam.invalid (predseda) scripsit:
I would like to ask you, if you know about something like Tanner
Helland's graphic tutorials
(http://tannerhelland.tripod.com/VBGraphicsTutorial.htm)but VB.Net
compatibile.

I need to create bitmap in array and then draw it on PictureBox or
Form but fast... Classic methode bitmap.SetPixel is very slow...

You will have to use C#'s 'unsafe' blocks to get really fast graphics
operations (you can encapsulate the routines in a C# class library and
use this library in your VB.NET application).

More info:

Part 1: <http://www.codeproject.com/cs/media/csharpgraphicfilters11.asp>
Part 2: <http://www.codeproject.com/cs/media/csharpfilters.asp>
Part 3: <http://www.codeproject.com/cs/media/edge_detection.asp>
Part 4: <http://www.codeproject.com/cs/media/imageprocessing4.asp>
Part 5: <http://www.codeproject.com/cs/media/DisplacementFilters.asp>
 
Back
Top