How to rewrite this theme call to drupal_render I have this call to the theme function in my code :

print theme('image_style', 
            array( 
                'path' =&gt; $news_image['uri'],
                'style_name' =&gt; 'thumbnail',
                'alt' =&gt; $news_image['alt'],
                'title' =&gt; $news_image['title'],)
            );


However in the theme function documentation you can read :


  Avoid calling this function directly. It is preferable to replace
  direct calls to the theme() function with calls to drupal_render() by
  passing a render array with a #theme key to drupal_render(), which in
  turn calls theme().


So, how do I rewrite the above simple function using drupal_render ?
Something like this...

$build = array(
  '#theme' =&gt; 'image_style',
  '#path' =&gt; $news_image['uri'],
  '#style_name' =&gt; 'thumbnail',
  '#alt' =&gt; $news_image['alt'],
  '#title' =&gt; $news_image['title'],
);

$rendered = drupal_render($build);


Where every named variable you would normally pass to the theme() function as the second parameter becomes a #-prefixed key in the render array.