Results 1 to 2 of 2

Thread: Flip Rotate Image in Image box

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Flip Rotate Image in Image box

    How do I flip and rotate Image in image box in VB6?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Flip Rotate Image in Image box

    Here is a quick sample to flip image - you'll need a Picturebox and Command button:
    VB Code:
    1. Private Sub Form_Load()
    2.     Picture1.AutoRedraw = True
    3. End Sub
    4.  
    5. 'flip image horizontally
    6. Private Sub Command1_Click()
    7. '============================
    8. Dim img As Image
    9.  
    10.     Set img = Controls.Add("VB.Image", "imgTemp")
    11.     With Picture1
    12.         img.Picture = .Image
    13.         .Cls
    14.         .PaintPicture img.Picture, _
    15.                       .ScaleWidth, _
    16.                       0, _
    17.                       -.ScaleWidth, _
    18.                       .ScaleHeight
    19.     End With
    20.     Controls.Remove "imgTemp"
    21.     Set img = Nothing
    22.  
    23. End Sub
    24.  
    25. 'flip image vertically
    26. Private Sub Command2_Click()
    27. '============================
    28. Dim img As Image
    29.  
    30.     Set img = Controls.Add("VB.Image", "imgTemp")
    31.     With Picture1
    32.         img.Picture = .Image
    33.         Picture1.Cls
    34.         .PaintPicture img.Picture, _
    35.                       0, _
    36.                       .ScaleHeight, _
    37.                       .ScaleWidth, _
    38.                       -.ScaleHeight
    39.     End With
    40.     Controls.Remove "imgTemp"
    41.     Set img = Nothing
    42.  
    43. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width