<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 14/01/2016 3:00, meilin wrote:<br>
    </div>
    <blockquote
cite="mid:CAHwQ_JMry-H5FrCUPECRnX9u=EHut07rbcdWMT9MemDppndaNg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Hi!</div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">we
          can draw some shapes in writer doc such as rect, line, circle
          and so on.</div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">now
          i want to know how to draw these shapes to a virtual device. </div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">i
          have already saw some code about drawing,but it's too hard for
          me to understand.</div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">so
          i ask you for help, if you have some documents about drawing?
          please send me,thank you!</div>
      </div>
    </blockquote>
    Yes i  exports Charts to a Dialog and also to a PNG grachip file<br>
    is use basic code below<br>
    we need the "Drawpage" with the chart in it<br>
    a "url" to save the png file<br>
    <br>
    sub exportChart(Drawpage as object, url as string )<br>
        'prepare the renderer for the GraphicExportFilter<br>
        oRenderer =
    createUnoService("com.sun.star.graphic.GraphicRendererVCL")<br>
        Dim sRect as new com.sun.star.awt.Rectangle<br>
         Wfactor = oChartDialog.size.width/oChartDialog.model.width<br>
         Hfactor = oChartDialog.size.height/oChartDialog.model.height<br>
        sRect.X = 0<br>
        sRect.Y = 0<br>
        sRect.Height =  180*Hfactor  'de hight is in charhe<br>
        sRect.Width = 29*Wfactor <br>
    <br>
        oRenderer.setPropertyValue("DestinationRect", sRect)<br>
        'the renderer shall paint to the dialog window<br>
        oRenderer.setPropertyValue("Device",
    oChartDialog.Peer.createGraphics.Device)<br>
         Dim aArgs (1) as new com.sun.star.beans.PropertyValue<br>
        aArgs(0).Name  = "GraphicRenderer"<br>
        aArgs(0).Value = oRenderer<br>
        xExporter =
    createUnoService("com.sun.star.drawing.GraphicExportFilter" )<br>
        xExporter.setSourceDocument(oSheet.DrawPage.getByIndex(0))<br>
        xExporter.filter(aArgs()) 'export to the dialog<br>
    <br>
        xExporter =
    createUnoService("com.sun.star.drawing.GraphicExportFilter")<br>
        xExporter.SetSourceDocument(Drawpage)<br>
    <br>
       Dim aURL as new com.sun.star.util.URL<br>
       aURL.complete = url<br>
       aArgs(0).Name  = "MediaType"<br>
       aArgs(0).Value = "image/png"<br>
       aArgs(1).Name  = "URL"<br>
       aArgs(1).Value = aURL<br>
    <br>
    REM Grafiek Opslaan<br>
       xExporter.filter(aArgs()) ' export to a png file<br>
    End Sub<br>
    <br>
    Hope it helps<br>
    <br>
    Fernand<br>
    <br>
    <br>
    <br>
    <blockquote
cite="mid:CAHwQ_JMry-H5FrCUPECRnX9u=EHut07rbcdWMT9MemDppndaNg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br
            style="background-color:inherit">
        </div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">another
          problem</div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">i
          want to draw some shapes in printpreview window, whether it's
          reasonable? </div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br
            style="background-color:inherit">
        </div>
        <div
          style="background-color:rgb(255,255,255);color:rgb(0,0,0);font-family:微软
          雅黑;font-size:14px;font-style:normal;font-variant:normal;font-
weight:normal;letter-spacing:normal;line-height:21px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">waiting
          for you help, thank you!</div>
        <br class="">
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LibreOffice mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>