X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2FmatitaMathView.ml;fp=helm%2Fsoftware%2Fmatita%2FmatitaMathView.ml;h=ad0a66294db314ff2ac47be9c59e45b2ee9df6ea;hb=4286d368b6d902a4b54c4cf8590c387f2cdb90ea;hp=492aece49cf3b3a322fdad5065ef7909f45ab615;hpb=bee436af0c6ceb1c83259c94036df8b12f901f2d;p=helm.git diff --git a/helm/software/matita/matitaMathView.ml b/helm/software/matita/matitaMathView.ml index 492aece49..ad0a66294 100644 --- a/helm/software/matita/matitaMathView.ml +++ b/helm/software/matita/matitaMathView.ml @@ -1576,23 +1576,29 @@ let mathViewer () = method show_uri_list ?(reuse=false) ~entry l = (self#get_browser reuse)#load entry - method screenshot status sequent metasenv subst filename = + method screenshot status sequent metasenv subst (filename as ofn) = let mathml = ApplyTransformation.nmml_of_cic_sequent status metasenv subst sequent in let w = GWindow.window ~title:"screenshot" () in + let width = 600 in + let height = 2000 in let m = GMathView.math_view - ~font_size:!current_font_size ~width:500 ~height:400 + ~font_size:!current_font_size ~width ~height ~packing:w#add ~show:true () in w#show (); m#load_root ~root:mathml#get_documentElement; let pixmap = m#get_buffer in - let pixbuf = GdkPixbuf.create ~width:500 ~height:400 () in + let pixbuf = GdkPixbuf.create ~width ~height () in GdkPixbuf.get_from_drawable ~dest:pixbuf pixmap; - let filename = filename ^ ".png" in + let filename = filename ^ "-raw.png" in GdkPixbuf.save ~filename ~typ:"png" pixbuf; + ignore(Sys.command (Printf.sprintf + "convert -trim -border 3 -bordercolor white %s %s" + (Filename.quote filename) + (Filename.quote (ofn ^ ".png")))); w#destroy (); end