Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
October 2017
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    

Calendar Calendar

RSS feeds


Yahoo! 
MSN 
AOL 
Netvibes 
Bloglines 


Social bookmarking

Social bookmarking Digg  Social bookmarking Delicious  Social bookmarking Reddit  Social bookmarking Stumbleupon  Social bookmarking Slashdot  Social bookmarking Yahoo  Social bookmarking Google  Social bookmarking Blinklist  Social bookmarking Blogmarks  Social bookmarking Technorati  

Bookmark and share the address of battle programmers alliance on your social bookmarking website

vb.net mirror an image

View previous topic View next topic Go down

vb.net mirror an image

Post  Admin on Sun Jan 08, 2012 2:02 pm

the following program will make a mirror image
for example if the picture has a doll with an earing on her right ear the mirror image will show the earing on her left ear.

this also can creat mirror text as leonardo devince used

controls :
2 picture boxes
btnInput
OpenFileDialog1
label1
label2 property visible set to false
SaveFileDialog1
btnSave
Code:
Public Class Form1
    Dim bitmap1 As Bitmap
    Private Sub btnInput_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnInput.Click
        Try
            OpenFileDialog1.ShowDialog()
            Label2.Visible = False
            Label2.Text = Nothing
            Dim fs As IO.FileStream = New IO.FileStream(OpenFileDialog1.FileName, IO.FileMode.Open)
            bitmap1 = Image.FromStream(fs)
            fs.Close()
            PictureBox1.Image = bitmap1
            Dim bmts As New Bitmap(bitmap1.Width, bitmap1.Height)
            For W = 1 To bitmap1.Width - 1
                For H = 1 To bitmap1.Height - 1
                    bmts.SetPixel(W, H, bitmap1.GetPixel(bitmap1.Width - W, H))
                Next
            Next
            PictureBox2.Image = bmts
        Catch ex As Exception
            MsgBox("select an input path picture file")
        End Try
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        OpenFileDialog1.FileName = Nothing
        SaveFileDialog1.FileName = Nothing
        SaveFileDialog1.Filter = "JPeg Image|*.jpg|Bitmap Image|*.bmp"
    End Sub
    Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
        Try
            SaveFileDialog1.ShowDialog()
            Label1.Text = SaveFileDialog1.FileName
            Dim bmts As New Bitmap(PictureBox2.Image)
            Dim bitmapToSave As New Bitmap(bmts)
            bitmapToSave.Save(SaveFileDialog1.FileName, Imaging.ImageFormat.Bmp)
            Label2.Text = "image mirroring completed"
            Label2.Visible = True
        Catch ex As Exception
            MsgBox("error")
        End Try
    End Sub
End Class

_________________
kurayami no kagi
avatar
Admin
Admin

Posts : 58
Join date : 2011-08-01

View user profile https://yotamarker.justforum.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum