gdiplus:GdipDrawImagePointsRect has a nosie vertical line output after resampled

Sebastian Lackner sebastian at fds-team.de
Fri Nov 21 10:19:22 CST 2014


Hi,

while looking quickly over your patch I noticed a couple of mistakes / things you should probably change:

On 21.11.2014 15:32, 刘昌辉 wrote:
>+    int src_img_height = src_rect.Height;
>+    int dest_img_width = dest_rect.X + dest_rect.Width;
>+    int dest_img_height = dest_rect.Height;
>+    BYTE* src_img_data = malloc (src_img_width*src_img_height*4);
>+    BYTE* dest_img_data = malloc (dest_img_width*dest_img_height*4);

You shouldn't use malloc(...) and free(...) in wine source, use HeapAlloc(...) and HeapFree(...) instead.

>+
>+    /*first line*/
>+    value = *( (DWORD*)dest_img_data + dest_rect.X) ;
>+    /*printf ("pixel(%d,%d) = %08x\n", dest_rect.X, 0, value );*/

I assume the printf was for debugging, remove it, or if it is really very important then use trace(...) instead.
Other tests use GdipBitmapGetPixel(...) for reading the color of specific pixels. If its possible to use that here too, it would look a bit better than directly accessing the memory.

>+    ok ( value > 0,
>+            "dest image color should same as src image color\n");

You are switching between different styles in your patch several times. Try to make the style match a bit more the sourrounding code, especially whitespace before and after functions. In this case a linebreak is also not really necessary for example, other lines are much longer.

Regards,
Sebastian



More information about the wine-devel mailing list