Skip to content

Commit

Permalink
2010-07-20 Sebastien Pouliot <sebastien@ximian.com>
Browse files Browse the repository at this point in the history
	* image.c: Use DPI from source image when creating a Graphics
	instance from it. Fix bug #556181
	[Backport r160638]


svn path=/branches/mono-2-6/libgdiplus/; revision=160640
  • Loading branch information
Sebastien Pouliot committed Jul 21, 2010
1 parent a98047e commit 3e91518
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2010-07-20 Sebastien Pouliot <sebastien@ximian.com>

* image.c: Use DPI from source image when creating a Graphics
instance from it. Fix bug #556181
[Backport r160638]

2010-07-14 Sebastien Pouliot <sebastien@ximian.com>

* lineargradientbrush.c: Do not accept empty (width/height)
Expand Down
3 changes: 2 additions & 1 deletion src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ GdipGetImageGraphicsContext (GpImage *image, GpGraphics **graphics)
image->active_bitmap->width, image->active_bitmap->height, image->active_bitmap->stride);

gfx = gdip_graphics_new (surface);
gfx->dpi_x = gfx->dpi_y = gdip_get_display_dpi ();
gfx->dpi_x = image->active_bitmap->dpi_horz <= 0 ? gdip_get_display_dpi () : image->active_bitmap->dpi_horz;
gfx->dpi_y = image->active_bitmap->dpi_vert <= 0 ? gdip_get_display_dpi () : image->active_bitmap->dpi_vert;
cairo_surface_destroy (surface);

gfx->image = image;
Expand Down

0 comments on commit 3e91518

Please sign in to comment.