Graphics.FromImage(Bitmap m) : Graphics « System.Drawing « VB.Net by API






Graphics.FromImage(Bitmap m)

  

Imports System
Imports System.Windows.Forms
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing.Imaging
Imports System.Drawing

Public Class MainClass

   Shared Sub Main()
        Dim bm As New Bitmap(256, 256)

        ' Draw on it.
        Dim gr As Graphics = Graphics.FromImage(bm)
        gr.Clear(Color.White)
        gr.DrawEllipse(Pens.Red, 0, 0, bm.Width - 1, bm.Height - 1)
        gr.DrawLine(Pens.Green, 0, 0, bm.Width - 1, bm.Height - 1)
        gr.DrawLine(Pens.Blue, bm.Width - 1, 0, 0, bm.Height - 1)

        ' Save the result as a JPEG file.
        bm.Save("test.gif", ImageFormat.Gif)
   End Sub 

End Class

   
    
  








Related examples in the same category

1.Graphics.DrawString
2.Graphics.MeasureString
3.Graphics.Clear(Color c)
4.Graphics.Clip
5.Graphics.CompositingMode
6.Graphics.CompositingQuality
7.Graphics.DrawArc
8.Graphics.DrawBezier
9.Graphics.DrawClosedCurve
10.Graphics.DrawCurve
11.Graphics.DrawEllipse(Pen, Int x, Int y, Int w, Int h)
12.Graphics.DrawIcon
13.Graphics.DrawImage(Bitmap bmp, Int x, Int y)
14.Graphics.DrawLine(Pen p, Int x, Int y, Int x1, Int y1)
15.Graphics.DrawPath
16.Graphics.DrawPolygon
17.Graphics.DrawRectangle(Pen pen1, Rectangle rectangle1)
18.Graphics.DrawString(String s, Font m, Brush , Int x, Int y)
19.Graphics.ExcludeClip
20.Graphics.FillClosedCurve
21.Graphics.FillEllipse
22.Graphics.FillPath
23.Graphics.FillPie
24.Graphics.FillPolygon
25.Graphics.FillRectangle(Brush b, Rectangle rect)
26.Graphics.MeasureCharacterRanges
27.Graphics.PageUnit
28.Graphics.ResetTransform()
29.Graphics.Restore
30.Graphics.ScaleTransform
31.Graphics.SetClip(Shape shape,CombineMode)
32.Graphics.SmoothingMode
33.Graphics.TextRenderingHint
34.Graphics.Transform
35.Graphics.TranslateTransform