dcsimg
October 21, 2018
Hot Topics:

Image Flipping to 270 Degrees

  • November 20, 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.

 

 


Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

Thanks for your registration, follow us on our social networks to keep up-to-date