summaryrefslogtreecommitdiff
path: root/docs/example.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-06-29 11:06:04 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-06-29 11:10:08 +0200
commitc161c5d5864384f42e540e8dcaed1c2cada63da7 (patch)
treebfb8e220e02f5b624f089c0b725b0210b38a6580 /docs/example.c
parent954e3bb173c3302bf458875e86c49c712f0789d4 (diff)
downloadmupdf-c161c5d5864384f42e540e8dcaed1c2cada63da7.tar.xz
Update examples.
Diffstat (limited to 'docs/example.c')
-rw-r--r--docs/example.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/example.c b/docs/example.c
index 231bbaeb..1bf67635 100644
--- a/docs/example.c
+++ b/docs/example.c
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
/* Render page to an RGB pixmap. */
fz_try(ctx)
- pix = fz_new_pixmap_from_page_number(ctx, doc, page_number, &ctm, fz_device_rgb(ctx));
+ pix = fz_new_pixmap_from_page_number(ctx, doc, page_number, &ctm, fz_device_rgb(ctx), 0);
fz_catch(ctx)
{
fprintf(stderr, "cannot render page: %s\n", fz_caught_message(ctx));
@@ -110,13 +110,13 @@ int main(int argc, char **argv)
printf("255\n");
for (y = 0; y < pix->h; ++y)
{
- unsigned char *p = &pix->samples[y * pix->w * pix->n];
+ unsigned char *p = &pix->samples[y * pix->stride];
for (x = 0; x < pix->w; ++x)
{
if (x > 0)
printf(" ");
printf("%3d %3d %3d", p[0], p[1], p[2]);
- p += 4;
+ p += pix->n;
}
printf("\n");
}