Mirror the image

Discussion in 'ASP .Net' started by mrajanikrishna@gmail.com, Jul 3, 2006.

  1. Guest

    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()
    , Jul 3, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders

    Re: Uploading files (Mirror site)

    John Saunders, Aug 20, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    398
    John Saunders
    Aug 20, 2003
  2. Mark Thomas

    Re: com.sun.mirror.apt

    Mark Thomas, Apr 15, 2006, in forum: Java
    Replies:
    3
    Views:
    3,277
  3. Gill Bates
    Replies:
    0
    Views:
    431
    Gill Bates
    Aug 4, 2003
  4. vim

    mirror image of tree

    vim, May 11, 2006, in forum: C Programming
    Replies:
    2
    Views:
    380
    Richard Bos
    May 11, 2006
  5. Mirror an image

    , Apr 1, 2014, in forum: Java
    Replies:
    5
    Views:
    178
    Jeff Higgins
    Apr 13, 2014
Loading...

Share This Page