Using ImageStyle with dependency injection Is there a way to use the ImageStyle class with dependency injection instead of a static call?

I am struggling to find an example.

At the moment I have a block which is importing the class with 

use Drupal\image\Entity\ImageStyle;


And then calls the load method with 

ImageStyle::load('machine_name')-&gt;buildUrl($path);


But I am wondering if there's a better way to do this?
Yes, inject the entity_type.manager service and load it that way:

$url = $this-&gt;entityTypeManager
  -&gt;getStorage('image_style')
  -&gt;load('machine_name')
  -&gt;buildUrl($path);