DotImage Knowledgebase

Home : ImgX : Copy a selection from one ImgXCtrl into another
Q10059 - HOWTO: Copy a selection from one ImgXCtrl into another

This can be easily done in the Selected event.  The following code assumes you have two ImgXCtrl objects on your form named ImgXCtrl1 and ImgXCtrl2.

Private Sub ImgXCtrl1_Selected(ByVal Left As Long, ByVal Top As Long, ByVal Width As Long, ByVal Height As Long)
    ' Stop display changes.
    ImgXCtrl2.AutoUpdate = False
   
    ' Copy the image.
    ImgXCtrl2.Images.Clear
    ImgXCtrl2.Images.Add ImgXCtrl1.Image
   
    ' Crop it.
    ImgXCtrl2.Effects.Crop Left, Top, Width, Height
   
    ' Refresh the display.
    ImgXCtrl2.AutoUpdate = True
    ImgXCtrl2.Update
End Sub

Now just set the ImgXCtrl1.MouseTool = ixmtSelect and select an area of the loaded image.

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2014. InstantASP Ltd. All Rights Reserved

preload preload preload