From e00e936d65bf98d0076d8fb26bf3724c64e83a89 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 2 Feb 2017 22:32:34 +1100 Subject: [PATCH] Update code sample [skip ci] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4d499fa35..9d947f227 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,8 @@ Here's an example of the code required to resize an image using the default Bicu ```csharp using (FileStream stream = File.OpenRead("foo.jpg")) using (FileStream output = File.OpenWrite("bar.jpg")) +using (Image image = new Image(stream)) { - Image image = new Image(stream); image.Resize(image.Width / 2, image.Height / 2) .Grayscale() .Save(output); @@ -92,7 +92,7 @@ new BrightnessProcessor(50).Apply(sourceImage, sourceImage.Bounds); Setting individual pixel values is perfomed as follows: ```csharp -Image image = new Image(400, 400); +using (image = new Image(400, 400) using (var pixels = image.Lock()) { pixels[200, 200] = Color.White;