Hello,
I have generated an image(T-Shirt). It was drawn using lines,
curves. After that I filled with
color(gr.fillpath(greenBrush,graphicsPath)). I used blackPen to draw
lines and curves with stroke 4. After filling the path, The whole image
is filled with color. Thats ok but i want to see the borders also.
Suppose I hv drawn body of the shirt. Next I need to attach collar and
sleeve those are drawn seperately and attached to body. Collar and
sleeve also same color of body. In this case I am not able to see
borders where the body ends, where is the collar, sleeve joinings...
coz the color is filled.
How can I see the borders?
This is my code for body. At the neck position, i need to fil color but
if I fill, i cant see the neck(V-neck/crew neck).
Dim finBmp As New Bitmap(200, 250)
Dim oBmp As New Bitmap(100, 250)
Dim nBmp As Bitmap
Dim gr As Graphics = Graphics.FromImage(oBmp)
Dim gr1 As Graphics = Graphics.FromImage(finBmp)
Dim text As String = textboxFromDate.Text
Dim colbg As Color = Color.FromName(text)
Dim redBr As New SolidBrush(Color.Red)
Dim bgBr As New SolidBrush(Color.White)
Dim grbr As New SolidBrush(colbg)
Dim blackPen As New Pen(Color.Black, 4)
Dim grPen As New Pen(Color.Green, 3)
Dim point1 As New Point(75, 15)
Dim point2 As New Point(76, 30)
Dim point3 As New Point(80, 50)
Dim point4 As New Point(85, 65)
Dim point5 As New Point(90, 75)
Dim pt5 As New Point(95, 80)
Dim curvePoints As Point() = {point1, point2, point3, point4,
point5, pt5}
Dim arr As Point() = {New Point(0, 50), New Point(0, 225), New
Point(95, 225), New Point(95, 80), New Point(90, 75), New Point(85,
65), New Point(80, 50), New Point(76, 30), New Point(75, 15), New
Point(75, 15), New Point(30, 5)}
Dim gpth As New GraphicsPath
gpth.AddLines(arr)
gr.FillRectangle(bgBr, 0, 0, 100, 250)
gr.DrawLine(blackPen, New Point(0, 50), New Point(0, 225))
gr.DrawLine(blackPen, New Point(0, 225), New Point(95, 225))
gr.DrawLine(blackPen, New Point(0, 50), New Point(30, 5))
gr.DrawLine(blackPen, New Point(30, 5), New Point(75, 15))
gr.DrawLine(blackPen, New Point(95, 225), New Point(95, 80))
gr.DrawCurve(blackPen, curvePoints)
gr.FillPath(grbr, gpth)
Dim bknkpts As Point() = {New Point(0, 10), New Point(10, 8),
New Point(20, 7), New Point(30, 5)}
'Dim bkpts As Point() = {New Point(0, 49), New Point(0, 11),
New Point(9, 9), New Point(21, 7), New Point(31, 6)}
gr.DrawCurve(blackPen, bknkpts)
'gpth.AddLines(bkpts)
'gr.FillPath(grbr, gpth)
gr.SmoothingMode = Drawing2D.SmoothingMode.Default
nBmp = oBmp.Clone()
nBmp.RotateFlip(RotateFlipType.Rotate180FlipY)
gr1.DrawImage(nBmp, 0, 0)
gr1.DrawImage(oBmp, 100, 0)
Response.ContentType = "image/gif"
finBmp.Save(Response.OutputStream, ImageFormat.Gif)
gr.Dispose()
gr1.Dispose()
oBmp.Dispose()
nBmp.Dispose()
finBmp.Dispose()