VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Image Flipping

by manikantan (12 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (3 Votes)

Explains on How to Flip Images to 270 Degrees

Rate Image Flipping

Article Written by
Manikantan
3rd Agenda,
Web Development,
India.
Website:www.3rdagenda.com
Email:[email protected]
Image Flipping
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

Articel by 
Manikantan
Email:[email protected]

Download this snippet    Add to My Saved Code

Image Flipping Comments

No comments have been posted about Image Flipping. Why not be the first to post a comment about Image Flipping.

Post your comment

Subject:
Message:
0/1000 characters