How can I render an image stocked in a custom module with an image style? I'am learning Drupal 8, and I would like create a custom module who create a block to add share button. The link of this button should be an image who stocked in my custom module. I would like use an image style on my picture.

Last but not least, i want use a render array.

In my build() method of my customblock.php i have whrite :

//create url link
$url = Url::fromUri('https://www.facebook.com/sharer/sharer.php?u='.$base_url.Url::fromRoute('&lt;current&gt;')-&gt;toString());

//create uri image
$pathmodule=drupal_get_path('module', 'share_configurable');
$urifacebook=$pathmodule.'/src/img/facebook.png';

//render array of link
if ($this-&gt;configuration['network']['facebook']=='facebook'){
  $build['link_facebook'] = [
    '#title' =&gt; [
      '#theme' =&gt; 'image_style',
      '#style_name' =&gt; 'thumbnail',
      '#uri' =&gt; $urifacebook,
    ],
    '#type' =&gt; 'link',
    '#url' =&gt; $url
  ];
}


The link is create, but the image is not render... Can you help me please ?
Thank to Hudri :
Image styles only work with managed files (uploaded, with entry in DB), not with static assets. Since this is a static asset anyway, just provide the correct size in your module.