private void ApplyEncryptDecrypt(ScrambleCommandFlags flags, LeadRectD bounds, int key) { LeadRect boundsInImage = _image.RectangleToImage(RasterViewPerspective.TopLeft, bounds.ToLeadRect()); LeadRect imageRect = LeadRect.Create(0, 0, _image.ImageWidth, _image.ImageHeight); flags |= ScrambleCommandFlags.Intersect; ScrambleCommand scrambleCommand = new ScrambleCommand(boundsInImage, key, flags); if (imageRect.Contains(boundsInImage)) { scrambleCommand.Run(_image); } }
private void ApplyEncryptDecrypt(ScrambleCommandFlags flags, LeadRectD bounds, int key) { LeadRect rect = bounds.ToLeadRect(); LeadRect imageRect = LeadRect.Create(0, 0, _image.ImageWidth, _image.ImageHeight); flags |= ScrambleCommandFlags.Intersect; ScrambleCommand scrambleCommand = new ScrambleCommand(rect, key, flags); if (imageRect.Contains(rect)) { scrambleCommand.Run(_image); } }