mono / libgdiplus

C-based implementation of the GDI+ API
http://www.mono-project.com/
MIT License
333 stars 171 forks source link

About the software interface confusion caused by some codes in image.c #721

Open mt-yu opened 2 years ago

mt-yu commented 2 years ago

OS: Ubuntu18.04 Desktop.

In the main branch,
GdipDrawImageRectRect Function

Question code 1: L830 if (!gdip_near_zero(srcwidth - dstwidth) && !gdip_near_zero(srcheight - dstheight))

The following is a part of the picture display based on the winfrom development software interface: image

The code is modified to ( only && to || ) if (!gdip_near_zero(srcwidth - dstwidth) || !gdip_near_zero(srcheight - dstheight)) the result is normal image Q1: I am not sure if I change && to || will it affect other places?

Question code 2: l825 filter = cairo_pattern_create_for_surface (preprocessed_image->surface); cairo_pattern_set_filter (filter, gdip_get_cairo_filter (graphics->interpolation));

The above two pieces of code are not used. Causes the interface texture to appear gradient. Comparison effect before and after code modification: before fixing image After modification image The code is modified as follows image

Q2: After the modification, the gradient disappeared, but you can clearly see that the chamfer in the upper left corner of the comparison chart above has become a right angle. Don't know what to do Eliminate the gradation, keep the chamfer?

Sorry!Since the company's intranet cannot upload github code, the problem can only be described in this way