Fixing the logo size

When you’re working with images in RDLC reports you often need to create images in a fixed size that matches the image box in you report definition. One of Clausl’s many great reporting blog posts is about a workaround to prevent unexpected lines on the image border. Clausl use the freeware Paint.NET which can be downloaded here¬†http://www.getpaint.net/.

Paint.NET can also be used to adjust images to a fixed size while preserving aspect ratio. It’s a simple two step procedure.

Lets use the image below as an example. As you can see it’s 611*400 pixels. Let’s say we want to create a 300*100 pixel image.

2015-02-13_08-29-21

Step 1: Resize

The first thing to do is to shrink it so it fits inside a 300*100 box. To do this you choose Image->Resize in the menu.

In this case the height will determine the size since using 300 as width would result in a to high image.

2015-02-13_08-32-57

 

Step 2: Change Canvas size

The image is now to narrow. We need to make it wider and we do this by changing the canvas size. To do this you choose Image->Canvas Size.

Here you should not maintain aspect ratio and by setting the anchor you decide how the image will be aligned.

2015-02-13_08-45-06

 

Done!

Now we have an image that is left aligned and exactly 300*100 pixels.

2015-02-13_08-46-56

 

2 Responses to “Fixing the logo size”

  1. Natalie 2016-03-04 at 08:30 #

    Your link to Claus does not work correctly. You can use https://clauslblog.wordpress.com/2013/04/23/working-with-images-in-rdlc-report/ instead, but unfortunately the images included there have not been transfered correctly.

    • Lars Westman 2016-03-04 at 11:06 #

      Thanks!

Leave a Reply