Changeset 111 for trunk


Ignore:
Timestamp:
Sep 1, 2012, 10:45:02 AM (10 years ago)
Author:
roman
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Snippets/CropImage/ImageCropBox.vb

    r109 r111  
    124124        DrawSpot(e.Graphics, ClientSelectionRectangle.Right, ClientSelectionRectangle.Bottom)
    125125    End Sub
    126     Private Function SourcePointFromPoint(Position As Point)
     126    Private Function SourcePointFromPoint(Position As Point) As Point
    127127        Dim SourcePosition As Point
    128128        SourcePosition.X = Math.Round((Position.X - ClientImageOrigin.X) * Image.Width / ClientImageExtent.Width)
     
    130130        SourcePointFromPoint = SourcePosition
    131131    End Function
    132     Private Function PointFromSourcePoint(SourcePosition As Point)
     132    Private Function PointFromSourcePoint(SourcePosition As Point) As Point
    133133        Dim Position As Point
    134134        Position.X = ClientImageOrigin.X + Math.Round(SourcePosition.X * ClientImageExtent.Width / Image.Width)
     
    179179                    SelectionRectangle = Rectangle.FromLTRB(SelectionRectangle.Left, SelectionRectangle.Top, SourcePosition.X, SourcePosition.Y)
    180180                Case 4 ' Move
    181                     Dim Move As Size = e.Location - MouseDownPosition
     181                    Dim Move As Size = SourcePointFromPoint(e.Location) - SourcePointFromPoint(MouseDownPosition)
    182182                    Dim PreSelection As Rectangle = MouseDownSelection
    183183                    PreSelection.Offset(Move)
Note: See TracChangeset for help on using the changeset viewer.