Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nwin committed Oct 29, 2014
1 parent 80a982e commit 1e1d71c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,19 @@ fn main() {
Example output:

![alt tag](https://raw.githubusercontent.com/ccgn/rust-image/master/examples/fractal.png "A Julia Fractal, c: -0.4 + 0.6i")

### 6.3 Writing raw buffers
If the high level interface is not needed because the image was obtained by other means, `rust-image` provides the function `save_buffer` to save a buffer to a file.

```rust
extern crate image;

fn main() {

let buffer: &[u8] = ...; // Generate the image data

// Save the buffer as "image.png"
image::save_buffer(&Path::new("image.png"), buffer, 800, 600, image::RGB(8))
}

```

0 comments on commit 1e1d71c

Please sign in to comment.