Nicolas wrote: > I think however matplotlib may be used only (and it will be even better > as I plan to make a Qt version in the future)
good idea. > So, in : > >>> from matplotlib.transforms import Value > >>> from matplotlib.backends.backend_agg import RendererAgg > >>> r = RendererAgg(50, 50, Value(72)) > >>> r.draw_image (0, 0, im) > > What is the correct format for im ? I'm no expert, but probably a string that's the same format as what tostring_argb() returns, so something like this should work (untested!): buffer = self.get_renderer().tostring_argb() l, h = self.GetSize() matrix = numpy.fromstring(buffer, dtype=numpy.byte) matrix.shape = (l,h,4) # 4 for a,r,g,b sub_matrix = matrix[min_x:max_x, min:y_max_y, :] r.draw_image (0, 0, sub_matrix.tostring()) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users