23. f~wgKv 25
Í 192 MB
(recommended: 128 MB for Professional, 256 MB for
Server)
Windows XP Professional Í 160 MB
(recommended: 192 MB)
Windows XP Home Í 96 MB
(recommended: 160 MB)
Available
Hard Disk
Space2
600 MB on system drive, 3 GB installation drive
Operating
System3, 4
Windows 2000®, Windows XP, and Windows NT 4.0
CD-ROM
or DVD-
ROM
Drive5
Required
Video 800 x 600, 256 colors (recommended: High Color 16-bit)
Mouse Microsoft mouse or compatible pointing device
c„_K c„_K j¨v½y‡qR Bb÷‡jk‡bi Rb¨ wm‡÷g ‡hvM¨Zv t
Visual Basic
.NET
Visual C++
.NET Visual C# .NET
Processor PC with a Pentium II-class processor, 450 MHz
(recommended: Pentium III-class, 600MHz)
RAM1
Windows NT 4.0 Workstation Í 64 MB, Windows NT 4.0
Server Í 160 MB
w
w
w
.fb.com
/tanbir.cox
69. f~wgKv 71
'Initialize the bitmap object by supplying
'the image file path
Dim b As New Bitmap(strFileToConvert)
'Conver the file in GIF format, also check out
'other formats like JPG, TIFF
b.Save(strFileToConvert + ".gif",
System.Drawing.Imaging.ImageFormat.Gif)
Console.Write("Sucessfully Converted to " & _
strFileToConvert & ".gif")
End Sub
End Class
wfwe WU †b‡U GDI+ eªvk wb‡q KvR t
wb‡Pi †KvWUzKz GKwU line, GKwU ellipse, GKwU curve Ges GKwU polygon Ae‡R±
Wª Ki‡e| †KvWwU‡Z Ae‡R±mg~n wdj Kivi Rb¨ Avwg †cb Ae‡R± e¨envi K‡iwQ|
protected overrides sub OnPaint(ByVal e As _
System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = e.Graphics
Dim pn As Pen = New Pen(Color.Green, 10)
g.DrawLine(pn, 100, 10, 30, 10)
g.DrawEllipse(New Pen(Color.Red, 20), 20, 40,_ 20,
20)
g.DrawBezier(New Pen(Color.Blue, 5), New Point(50,
60), New Point(150, 10), New Point(200, 230), New
Point(100, 100))
Dim point1 As PointF = New PointF(50F, 250F)
Dim point2 As PointF = New PointF(100F, 25F)
Dim point3 As PointF = New PointF(150F, 5F)
Dim point4 As PointF = New PointF(250F, 50F)
Dim point5 As PointF = New PointF(300F, 100F)
Dim curvePoints As PointF() = {point1, point2,_
point3, point4, point5}
g.DrawPolygon(New Pen(Color.Chocolate, 10),_
curvePoints)
End Sub
'Brush and Brushes Types
'Brush type is an abstract base class. 'HatchBrush,
LinearGradientBrush, 'PathGradientBrush, SolidBrush
w
w
w
.fb.com
/tanbir.cox
70. 72 wfRyq¨vj †ewmK WU †bU nv‡Z Lwo
and TextureBrush 'classes are inherited from Brush
class. You 'don't use this class directly.
'All brush types are defined in System.Drawing 'and
its helper namespaces. Before using 'brushes, you
need to add reference to this 'namespace. HatchBrush
and GradientBrush are 'defined in
System.Drawing.Drawing2D namespace.
'You use brushes to fill GDI+ objects with 'certain
kind of brush. You generally call Fill 'methods of
Graphics class to fill various 'objects such as
Ellipse, Arc, or Polygon. 'There are different kinds
of brushes. For 'example, solid brush, hatch brush,
texture 'brush, and gradient brush.
'Solid Brushes
'Solid brushes are normal brushes with no 'style. You
fill GDI+ object with a color. 'SolidBrush type is
used to work with solid 'brushes.
Dim g As Graphics = e.Graphics
Dim sdBrush1 As SolidBrush = New _
SolidBrush(Color.Red)
Dim sdBrush2 As SolidBrush = New _
SolidBrush(Color.Green)
Dim sdBrush3 As SolidBrush = New _
SolidBrush(Color.Blue)
g.FillEllipse(sdBrush2, 20, 40, 60, 70)
Dim rect As Rectangle = New Rectangle(0, 0, _ 200,
100)
g.FillPie(sdBrush3, 0, 0, 200, 40, 0F, 30F)
Dim point1 As PointF = New PointF(50F, 250F)
Dim point2 As PointF = New PointF(100F, 25F)
Dim point3 As PointF = New PointF(150F, 5F)
Dim point4 As PointF = New PointF(250F, 50F)
Dim point5 As PointF = New PointF(300F, 100F)
Dim curvePoints As PointF() = {point1, point2,_
point3, point4, point5}
g.FillPolygon(sdBrush1, curvePoints)
'Hatch Brushes
'using System.Drawing.Drawing2D;
Useful Bangla eBooks :-www.facebook.com/tanbir.ebooks
Library of free ebooks:www.tanbircox.blogspot.com
71. f~wgKv 73
'The hatch brushes are brushes with a hatch 'style, a
foreground color, and a background 'color. Hatches
are a combination of rectangle 'lines and the area
between the lines. The 'foreground color defines the
color of lines; 'the background color defines the
color of area 'between lines.
'HatchStyle defines the hatch styles.
'Member Name
'BackwardDiagonal
'Cross
'DarkDownwardDiagonal
'DarkHorizontal
'DarkUpwardDiagonal
'DarkVertical
'DashedDownwardDiagonal
'DashedHorizontal
'DashedUpwardDiagonal
'DashedVertical
'DiagonalBrick
'DiagonalCross
'Divot
'DottedDiamond
'DottedGrid
'ForwardDiagonal
w
w
w
.fb.com
/tanbir.cox
72. 74 wfRyq¨vj †ewmK WU †bU nv‡Z Lwo
'The following code shows how to draw hatch 'brushes.
Protected Overrides Sub OnPaint(ByVal e As _
System.Windows.Forms.PaintEventArgs)
Dim g As Graphics = e.Graphics
Dim hBrush1 As HatchBrush = New
HatchBrush(HatchStyle.DiagonalCross, _
Color.Chocolate, Color.Red)
Dim hBrush2 As HatchBrush = New
HatchBrush(HatchStyle.DashedHorizontal, _
Color.Green, Color.Black)
Dim hBrush3 As HatchBrush = New _
HatchBrush(HatchStyle.Weave, Color.BlueViolet,_
Color.Blue)
g.FillEllipse(hBrush1, 20, 80, 60, 20)
Dim rect As Rectangle = New Rectangle(0, 0,_ 200,
100)
Dim point1 As PointF = New PointF(50F, 250F)
Dim point2 As PointF = New PointF(100F, 25F)
Dim point3 As PointF = New PointF(150F, 5F)
Dim point4 As PointF = New PointF(250F, 50F)
Dim point5 As PointF = New PointF(300F, 100F)
Dim curvePoints As PointF() = {point1, point2,_
point3, point4, point5}
g.FillPolygon(hBrush2, curvePoints)
End Sub
'Texture Brushes
'The texture brushes provides you to use an 'image as
brush and fill GDI+ objects with the 'brush. The
following code use ¡°myfile.bmp¡± 'as a brush. You
need to define an Image object 'and create brush with
that Image and pass the 'brush into Fill method of
GDI+ objects.
Dim txBrush As TextureBrush
Useful Bangla eBooks :-www.facebook.com/tanbir.ebooks
Library of free ebooks:www.tanbircox.blogspot.com
74. 76 wfRyq¨vj †ewmK WU †bU nv‡Z Lwo
Imports System
Imports System.Data
Imports System.Data.OleDb
'Sample Code:
'In the sample code, I've used an Access 'database to
read the data. Same well known 'steps.
Create Connection
Open Connection
'Create Command Object
'Call Command's ExecuteReader() to return 'DataReader
and used DataReader to get the 'data.
Try
'construct the command object and open a 'connection
to the Contacts table
Dim cmdString As String = "Select ContactID,_
FirstName, LastName from Contacts"
Dim connString As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data _
Source=C:contactmanagement.mdb"
Dim myConnection As OleDbConnection = New _
OleDbConnection(connString)
' Open connection
myConnection.Open()
'Create OleDbCommand object
Dim TheCommand As OleDbCommand = New _
OleDbCommand(cmdString, myConnection)
TheCommand.CommandType = CommandType.Text
'Create a DataReader and call Execute on the 'Command
Object to construct it
Dim TheDataReader As OleDbDataReader = _
TheCommand.ExecuteReader()
While TheDataReader.Read()
Useful Bangla eBooks :-www.facebook.com/tanbir.ebooks
Library of free ebooks:www.tanbircox.blogspot.com
77. f~wgKv 79
'You can render text using a similiar method:
Private Sub DrawGradientString(ByVal text as _
String, ByVal color1 As Color, ByVal color2 _ As
Color, ByVal mode As _
System.Drawing.Drawing2D.LinearGradientMode)
Dim a As New System.Drawing.Drawing2D._
LinearGradientBrush(New RectangleF(0, 0, 100,_ 19),
color1, color2, mode)
Dim g As Graphics = Me.CreateGraphics
Dim f As Font
f = New Font("arial", 20, FontStyle.Bold,_
GraphicsUnit.Pixel)
g.DrawString(text, f, a, 0, 0)
g.Dispose()
End Sub
'For this method it is used like this:
DrawGradientString("Hello To You", Color.blue,_
Color.firebrick, _
Drawing.Drawing2D.LinearGradientMode.Vertical)
w
w
w
.fb.com
/tanbir.cox
www.facebook.com/tanbir.cox