# HG changeset patch # User Sebastien Jodogne # Date 1405605546 -7200 # Node ID be849646b2bfb9f64cc60c00cce48360bf6abe85 # Parent 8d1845feb27732d5a2f84643099ee137b924962a sample diff -r 8d1845feb277 -r be849646b2bf Plugins/Samples/Basic/Plugin.c --- a/Plugins/Samples/Basic/Plugin.c Thu Jul 17 15:55:40 2014 +0200 +++ b/Plugins/Samples/Basic/Plugin.c Thu Jul 17 15:59:06 2014 +0200 @@ -88,20 +88,22 @@ if (request->method != OrthancPluginHttpMethod_Get) { OrthancPluginSendMethodNotAllowed(context, output, "GET"); - return -1; + } + else + { + value = 0; + for (y = 0; y < 256; y++) + { + for (x = 0; x < 256; x++, value++) + { + buffer[value] = value; + } + } + + OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16, + 256, 256, sizeof(uint16_t) * 256, buffer); } - value = 0; - for (y = 0; y < 256; y++) - { - for (x = 0; x < 256; x++, value++) - { - buffer[value] = value; - } - } - - OrthancPluginCompressAndAnswerPngImage(context, output, OrthancPluginPixelFormat_Grayscale16, - 256, 256, sizeof(uint16_t) * 256, buffer); return 0; }