Last active
December 10, 2015 22:18
-
-
Save eldewall/4501725 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public ImageCreationResult Create() { | |
| double load, resize, rotate, create, sharpen; | |
| byte[] imageBytes = null; | |
| using (Bitmap source = ActionTimer.Time(() => { return Load(); }, out load)) { | |
| using (Bitmap resized = ActionTimer.Time(() => { return Resize(source); }, out resize)) { | |
| ActionTimer.Time(() => { Rotate(resized); }, out rotate); | |
| ActionTimer.Time(() => { Sharpen(resized); }, out sharpen); | |
| ActionTimer.Time(() => { | |
| imageBytes = ImageTools.CreateJpeg(resized, Spec.Quality); | |
| }, out create); | |
| } | |
| } | |
| Timings t = new Timings(load, resize, rotate, create, sharpen); | |
| return new ImageCreationResult(imageBytes, t); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment