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.
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.
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.
Done!
Now we have an image that is left aligned and exactly 300*100 pixels.
3 Responses to “Fixing the logo size”