C# Resizing image padded with image reflection

Fullført Lagt ut 5 år siden Betales ved levering
Fullført Betales ved levering

Dear C# experts,

Resizing image with aspect-ratio maintained and padded with image reflection on sides.

Please refer to the attachments.

"[login to view URL]" is the input.

With the following code, the resized output image is "[login to view URL]"

int width = 192; int height = 192;

Bitmap outbmp = new Bitmap(width, height);

//Bitmap inpbmp = new Bitmap(source);

using (Graphics gfx = [login to view URL](outbmp))

{

using (SolidBrush brush = new SolidBrush([login to view URL]))

{

[login to view URL](brush, 0, 0, width, height);

}

float scale = [login to view URL]((float)width / (float)[login to view URL], (float)height / (float)[login to view URL]);

var scaleWidth = (int)([login to view URL] * scale);

var scaleHeight = (int)([login to view URL] * scale);

[login to view URL](source, ((int)width - scaleWidth) / 2, ((int)height - scaleHeight) / 2, scaleWidth, scaleHeight);

}

You can see the image is resized and placed in the middle. But there is black padding on both sides. Instead of the black padding on the both side of the image, I want the same image to be reflected. For extra clarity on the reflecting, please refer to the this image "[login to view URL]"

The expected image is shown in this image "[login to view URL]"

Least computation requirements with fast execution time is also expected from your code.

Happy Bidding. If you need further clarification, please let me know.

C# Programmering

Prosjekt-ID: #18064111

Om prosjektet

3 bud Eksternt prosjekt Aktiv 5 år siden

Tildelt til:

vano101

Hello I have almost 9 years of experience with C#, Windows Forms and Microsoft .NET Framework. Also, I have extensive experience with image manipulation, including resizing, rotation and Bicubic interpolation

$25 USD på 1 dag
(611 omtaler)
7.1

3 frilansere byr i gjennomsnitt $33 for denne jobben

vpr58e3445e03cda

We have gone through the requirements that you have mentioned and we will help you in this. Message us for further discussion. Feel Free to contact us. Thank you!

$50 USD på 1 dag
(3 Omtaler)
1.5
sujon214

sir, I had 5 years experience on e programming task. so you can hire me. Thanks

$25 USD på 3 dager
(0 Omtaler)
0.0