C# Resizing image padded with image reflection

Đã hoàn thành Đã đăng vào 5 năm trước Thanh toán khi bàn giao
Đã hoàn thành Thanh toán khi bàn giao

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.

Lập trình C#

ID dự án: #18064111

Về dự án

3 đề xuất Dự án từ xa 5 năm trước đang mở

Được trao cho:

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 trong 1 ngày
(611 Đánh Giá)
7.1

3 freelancer chào giá trung bình$33 cho công việc này

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 trong 1 ngày
(3 Nhận xét)
1.5
sujon214

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

$25 USD trong 3 ngày
(0 Nhận xét)
0.0