September 1, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

Image Flipping to 270 Degrees

  • November 19, 2002
  • By Developer.com Staff
  • Send Email »
  • More Articles »

Another use of Visual Basic is the Flipping Images using the Paintpicture.Used to Flip the images around the Center either for 90 180 270 degrees.Can be useful in DTP works.

PaintPicture is the most useful method of the pciturebox control which takes 10 Arguments to give various Effects to still images the Arguments are:

1) Source Picture
2) Dest X
3) Dest Y
4) Dest Width
5) Dest Height
6) Source X
7) Source Y
8) Source Width
9) Source Height
10)Operation code.

Private Sub Cmd_hflip_Click() _
        picture_dest.PaintPicture _
        picture_src.Picture, 0, 0, _
        picture_src.ScaleWidth, _
        picture_src.ScaleHeight, _
        picture_src.ScaleWidth, 0, _
        -picture_src.ScaleWidth, _
        picture_src.ScaleHeight, &HCC0020
End Sub

Private Sub Cmd_vflip_Click() _
        picture_dest.PaintPicture _
        picture_src.Picture, 0, 0, _
        picture_src.ScaleWidth, _
        picture_src.ScaleHeight, 0, _
        picture_src.ScaleHeight, _
        picture_src.ScaleWidth, _
        -picture_src.ScaleHeight, &HCC0020
End Sub
          
Private Sub Cmd_load_Click()
        On Error Resume Next
        CommonDialog.ShowOpen
        picture_src.Picture = _
               LoadPicture(CommonDialog1.filename)
        If Err.Number = 481 Then MsgBox _
               ("The File Mentioned By You Is not A image file")
End Sub

Private Sub Cmd_save_Click()
	CommonDialog1.ShowSave
	SavePicture picture_dest.Image, _
                    CommonDialog1.filename
End Sub

Private Sub Cmd_exit_Click()
	Unload Me
End Sub

Private Sub Rotate_Click()
            picture_dest.PaintPicture _
            picture_src.Picture, 0, 0, _
            picture_src.ScaleWidth, _
            picture_src.ScaleHeight, _
            picture_src.ScaleWidth, _
            picture_src.ScaleHeight, _
            -picture_src.ScaleWidth, _
            -picture_src.ScaleHeight, &HCC0020
End Sub






Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel