Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

2009-03-20 Tom Hindle <tom_hindle@sil.org>

	*  graphics.c Allow GdipCreateFromHDC to work on the HDC of objects 
	previousy created with GdipCreateFromHDC. Also allow GdipCreateFromHDC
	to work with gtMemoryBitmap types.


svn path=/trunk/libgdiplus/; revision=129909
  • Loading branch information...
commit 32bb41ee4b7c39b3c8c24bf16aacbeff188338ee 1 parent 90d6ff7
Sebastien Pouliot authored
Showing with 18 additions and 0 deletions.
  1. +6 −0 src/ChangeLog
  2. +12 −0 src/graphics.c
View
6 src/ChangeLog
@@ -1,3 +1,9 @@
+2009-03-20 Tom Hindle <tom_hindle@sil.org>
+
+ * graphics.c Allow GdipCreateFromHDC to work on the HDC of objects
+ previousy created with GdipCreateFromHDC. Also allow GdipCreateFromHDC
+ to work with gtMemoryBitmap types.
+
2009-01-28 Sebastien Pouliot <sebastien@ximian.com>
* image.c: Revert last change wrt resolution
View
12 src/graphics.c
@@ -151,6 +151,9 @@ gdip_graphics_common_init (GpGraphics *graphics)
graphics->render_origin_y = 0;
graphics->dpi_x = graphics->dpi_y = 0;
+ graphics->display = NULL;
+ graphics->drawable = NULL;
+
gdip_graphics_reset (graphics);
}
@@ -228,6 +231,9 @@ GdipCreateFromHDC (void *hDC, GpGraphics **graphics)
}
#endif
+ if (clone->type == gtMemoryBitmap)
+ return GdipGetImageGraphicsContext (clone->image, graphics);
+
XGetGeometry (clone->display, clone->drawable, &root,
&x, &y, &w, &h, &border_w, &depth);
@@ -242,6 +248,12 @@ GdipCreateFromHDC (void *hDC, GpGraphics **graphics)
(*graphics)->dpi_x = (*graphics)->dpi_y = gdip_get_display_dpi ();
cairo_surface_destroy (surface);
+ if ((*graphics)->drawable)
+ (*graphics)->drawable = clone->drawable;
+
+ if ((*graphics)->display)
+ (*graphics)->display = clone->display;
+
return Ok;
}
Please sign in to comment.
Something went wrong with that request. Please try again.