[Mono-devel-list] Re: [Mono-patches] libgdiplus/src ChangeLog,1.76,1.77 gdip.h,1.35,1.36 gdipImage.h,1.8,1.9 gifcodec.c,1.4,1.5 image.c,1.13,1.14 jpegcodec.c,1.3,1.4 jpegcodec.h,1.2,1.3 pngcodec.c,1.7,1.8 pngcodec.h,1.4,1.5 tiffcodec.c,1.3,1.4

Peter Dennis Bartok peter at novonyx.com
Sat Apr 10 22:11:48 EDT 2004


Vlad,

It seems that this patch broke the integration of System.Drawing and 
Wine for System.Windows.Forms. All I get after applying it is a white 
rectangle for any control that is drawn through System.Drawing.

I've replaced it with the old function and #ifdef 0'd your version. I 
didn't have the time to debug why it doesn't work.

I've also logged bug #56803.

Cheers,
   Peter

Vladimir Vukicevic wrote:
[...]
> * image.c: blit surface directly for painting images,
> instead of creating a graphics context for it first

[...]

> Index: image.c
> ===================================================================
> RCS file: /cvs/public/libgdiplus/src/image.c,v
> retrieving revision 1.13
> retrieving revision 1.14
> diff -u -d -r1.13 -r1.14
> --- image.c	5 Apr 2004 06:13:43 -0000	1.13
> +++ image.c	6 Apr 2004 08:43:32 -0000	1.14
> @@ -1,4 +1,5 @@
> -/*

[...]

>  
> @@ -145,153 +147,158 @@
>  GpStatus
>  GdipDrawImageRectI (GpGraphics *graphics, GpImage *image, int x, int y, int width, int height)
>  {
> -	GpGraphics *image_graphics = 0;
> -	cairo_surface_t *image_surface = 0;
> +    /* cairo_pattern_t *image_pattern = NULL; */
>  
> -	if (!graphics || !image)
> -		return InvalidParameter;
> +    if (!graphics || !image)
> +        return InvalidParameter;
>  
> -	if (image->type != imageBitmap)
> -		return InvalidParameter;
> -	
> -	/* printf("GdipDrawImageRectI. %p (type %d), %p, (%d,%d) (%d,%d)\n", graphics, graphics->type, image, x, y, width, height); */
> -	
> -	GdipGetImageGraphicsContext (image, &image_graphics);
> -	if (image_graphics == 0) {
> -		printf("GdipDrawImageRectI. Error : cannot get graphics\n");
> -		return GenericError;
> -	}
> -	image_surface = cairo_current_target_surface (image_graphics->ct);
> -	if (image_surface == 0) {
> -		printf("GdipDrawImageRectI. Error : cannot get surface\n");
> -		return GenericError;
> -	}
> -	cairo_move_to (graphics->ct, x, y);
> -	cairo_set_pattern (graphics->ct, image_surface);
> -	cairo_rectangle (graphics->ct, x, y, width, height);
> +    if (image->type != imageBitmap)
> +        return InvalidParameter;
> +    
> +    cairo_move_to (graphics->ct, x, y);
> +    /* image_pattern = cairo_pattern_create_for_surface (image->surface); */
> +    cairo_set_pattern (graphics->ct, image->surface);
> +    cairo_rectangle (graphics->ct, x, y, width, height);
>  
> -        if (width != image->width || height != image->height) {
> -            cairo_scale (graphics->ct,
> -                         (double) width / image->width,
> -                         (double) height / image->height);
> -            cairo_fill (graphics->ct);
> -            cairo_default_matrix (graphics->ct);
> -            
> -        } else {
> -            cairo_fill (graphics->ct);
> -        }
> -	
> -	return Ok;
> +    if (width != image->width || height != image->height) {
> +        cairo_scale (graphics->ct,
> +                     (double) width / image->width,
> +                     (double) height / image->height);
> +        cairo_fill (graphics->ct);
> +        cairo_default_matrix (graphics->ct);
> +        
> +    } else {
> +        cairo_fill (graphics->ct);
> +    }
> +
> +    /* cairo_pattern_destroy (image_pattern); */
> +
> +    return Ok;
>  }
>  
>  



More information about the Mono-devel-list mailing list