Mirror the image

M

mrajanikrishna

Hello,

I have generated an image using System.Drawing.Bitmap namespace.
How can I get the mirror image along with the original image.
I am giving my code. This code will generate half of my image(shirt
piece). Remaining half, I want to mirror it. Pls hv a look and suggest
me an idea.

thanks in advance

Dim oBmp As New Bitmap(200, 200)
Dim gr As Graphics = Graphics.FromImage(oBmp)

Dim redBr As New SolidBrush(Color.Red)
Dim bgBr As New SolidBrush(Color.Beige)
Dim grBr As New SolidBrush(Color.Green)
Dim blackPen As New Pen(Color.Black, 2)
Dim grPen As New Pen(Color.Green, 3)
Dim point1 As New Point(160, 15)
Dim point2 As New Point(160, 20)
Dim point3 As New Point(163, 35)
Dim point4 As New Point(165, 42)
Dim pt5 As New Point(170, 52)
Dim pt6 As New Point(180, 58)
Dim pt7 As New Point(195, 60)
Dim curvePoints As Point() = {point1, point2, point3, point4,
pt5, pt6, pt7}
Dim arr As Point() = {New Point(100, 30), New Point(100, 175),
New Point(195, 175), New Point(195, 60), New Point(180, 58), New
Point(170, 52), New Point(165, 42), New Point(163, 35), New Point(160,
20), New Point(160, 15), New Point(130, 5)}
Dim gpth As New GraphicsPath
gpth.AddLines(arr)

gr.FillRectangle(bgBr, 0, 0, 200, 200)
gr.DrawLine(blackPen, New Point(100, 30), New Point(100, 175))
gr.DrawLine(blackPen, New Point(100, 175), New Point(195, 175))
gr.DrawLine(blackPen, New Point(100, 30), New Point(130, 5))
gr.DrawLine(blackPen, New Point(130, 5), New Point(160, 15))
gr.DrawLine(blackPen, New Point(195, 175), New Point(195, 60))
gr.DrawCurve(blackPen, curvePoints)
gr.FillPath(grBr, gpth)

gr.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
Response.ContentType = "image/gif"
oBmp.Save(Response.OutputStream, ImageFormat.Gif)
gr.Dispose()
oBmp.Dispose()
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top