<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WaveformGraph to Image in Measurement Studio for .NET Languages</title>
    <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124205#M417</link>
    <description>Hi Elton,&lt;BR /&gt;&lt;BR /&gt;This is exactly what I want!  I found a .NET Report Printing library that makes it very easy to print text, headers, footers, columns, tables, and images (via System.Image), but it does it separately from the PrintPage event handler.  I couldn't figure out how to get the Image independently from this event.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Derek &lt;BR /&gt;</description>
    <pubDate>Wed, 17 Mar 2004 19:40:32 GMT</pubDate>
    <dc:creator>dprice</dc:creator>
    <dc:date>2004-03-17T19:40:32Z</dc:date>
    <item>
      <title>WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124202#M414</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I am interested in converting a WaveformGraph's System.Drawing.Graphics object used in the PrintPage handler to a System.Drawing.Image object.  Here's what I'm trying to do:&lt;BR /&gt;&lt;BR /&gt;Graphics g = e.Graphics;&lt;BR /&gt;Rectangle bounds = e.MarginBounds;&lt;BR /&gt;waveformGraph1.Draw( new ComponentDrawArgs( g, bounds ) ) ;&lt;BR /&gt;&lt;BR /&gt;Image img = g.?? ;&lt;BR /&gt;&lt;BR /&gt;Can this be done or is there a better method of doing this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;Derek &lt;BR /&gt;</description>
      <pubDate>Wed, 17 Mar 2004 18:32:23 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124202#M414</guid>
      <dc:creator>dprice</dc:creator>
      <dc:date>2004-03-17T18:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124203#M415</link>
      <description>Derek,&lt;BR /&gt;&lt;BR /&gt;I am assuming e.Graphics is the Graphics object from the event arguments of the PrintPage handler.&lt;BR /&gt;&lt;BR /&gt;I don't think there is a way to go from a Graphics object to an Image. You can create another Graphics object from an existing Image. For this example, assume that the Image that you are trying to create is a Bitmap. Then, your code would be modified to look something like this:&lt;BR /&gt;&lt;BR /&gt;Graphics g = e.Graphics;&lt;BR /&gt;Rectangle bounds = e.MarginBounds;&lt;BR /&gt;waveformGraph1.Draw( new ComponentDrawArgs( g, bounds ) ) ;&lt;BR /&gt;&lt;BR /&gt;// This will draw the printed output to an image&lt;BR /&gt;// of type bitmap. You can substitute Bitmap&lt;BR /&gt;// to be any other Image derived type.&lt;BR /&gt;Bitmap img = new Bitmap(bounds);&lt;BR /&gt;Graphics imgGraphics = Graphics.FromImage(img);&lt;BR /&gt;waveformGraph1.Draw( new&lt;BR /&gt; ComponentDrawArgs( imgGraphics, bounds ) );&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Abhishek Ghuwalewala&lt;BR /&gt;Measurement Studio &lt;BR /&gt;</description>
      <pubDate>Wed, 17 Mar 2004 18:59:38 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124203#M415</guid>
      <dc:creator>Abhishek Ghuwalewala</dc:creator>
      <dc:date>2004-03-17T18:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124204#M416</link>
      <description>You don't convert a Graphics object to an image - the Graphics class provides the ability to draw to a device context where that context can be an image, the screen, a printer, etc.  What you can do, though, is create an image, then get a Graphics object from the image, then drawing operations on that Graphics object will be directed to the image.  So, for example, if you wanted to dynamically create an image and draw the WaveformGraph to it, you could do this:&lt;BR /&gt;&lt;BR /&gt;using NationalInstruments.UI;&lt;BR /&gt;using System.Drawing.Imaging;&lt;BR /&gt;&lt;BR /&gt;// ...&lt;BR /&gt;&lt;BR /&gt;Size imageSize = new Size(300, 200);&lt;BR /&gt;&lt;BR /&gt;using (Bitmap bitmap = new Bitmap(imageSize.Width, imageSize.Height, PixelFormat.Format32bppArgb))&lt;BR /&gt;using (Graphics g = Graphics.FromImage(bitmap))&lt;BR /&gt;{&lt;BR /&gt;    waveformGraph1.Draw(new Compon&lt;BR /&gt;entDrawArgs(g, new Rectangle(new Point(0, 0), imageSize)));&lt;BR /&gt;&lt;BR /&gt;    // ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;- Elton &lt;BR /&gt;</description>
      <pubDate>Wed, 17 Mar 2004 19:02:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124204#M416</guid>
      <dc:creator>Elton Wells</dc:creator>
      <dc:date>2004-03-17T19:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124205#M417</link>
      <description>Hi Elton,&lt;BR /&gt;&lt;BR /&gt;This is exactly what I want!  I found a .NET Report Printing library that makes it very easy to print text, headers, footers, columns, tables, and images (via System.Image), but it does it separately from the PrintPage event handler.  I couldn't figure out how to get the Image independently from this event.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Derek &lt;BR /&gt;</description>
      <pubDate>Wed, 17 Mar 2004 19:40:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124205#M417</guid>
      <dc:creator>dprice</dc:creator>
      <dc:date>2004-03-17T19:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124206#M418</link>
      <description>Hi Elton,&lt;BR /&gt;&lt;BR /&gt;I finally had a chance to go back and work on this, but had a question.  Your code does exactly what I need, but the image is not very good.  I've attached an image of a portion of the app running and the print preview using your suggested method.  It's very grainy.  Any ideas on how to fix this?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Derek &lt;BR /&gt;</description>
      <pubDate>Mon, 26 Apr 2004 18:56:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124206#M418</guid>
      <dc:creator>dprice</dc:creator>
      <dc:date>2004-04-26T18:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124207#M419</link>
      <description>Hi Elton,&lt;BR /&gt;&lt;BR /&gt;I've attached a sample that demostrates this.  The screenshots above don't really show the problem.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Derek &lt;BR /&gt;</description>
      <pubDate>Tue, 27 Apr 2004 13:52:00 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/124207#M419</guid>
      <dc:creator>dprice</dc:creator>
      <dc:date>2004-04-27T13:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318365#M2863</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;Has anyone found a better solution to this problem?&lt;BR /&gt;
&lt;BR /&gt;
The print preview results are a little out-of-focus.&lt;BR /&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Feb 2006 00:45:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318365#M2863</guid>
      <dc:creator>penewman</dc:creator>
      <dc:date>2006-02-01T00:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318649#M2866</link>
      <description>Try making the size of the bitmap the same size as the graph control&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;private Image GetWaveformGraphImage()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;B&gt;Size imageSize = waveformGraph1.Size ;&lt;/B&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Image bitmap = new Bitmap( imageSize.Width, imageSize.Height, PixelFormat.Format32bppArgb ) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; using ( Graphics g = Graphics.FromImage( bitmap ) )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; waveformGraph1.Draw( new ComponentDrawArgs( g, new Rectangle(new Point(0, 0), imageSize ) ) );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return bitmap;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&lt;BR /&gt;I think this should clear up the graph image.&lt;BR /&gt;Hope this helps. &lt;BR /&gt;</description>
      <pubDate>Wed, 01 Feb 2006 15:38:20 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318649#M2866</guid>
      <dc:creator>bilalD</dc:creator>
      <dc:date>2006-02-01T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: WaveformGraph to Image</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318662#M2867</link>
      <description>great idea &lt;BR /&gt;
thanks&lt;BR /&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Feb 2006 15:49:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/318662#M2867</guid>
      <dc:creator>penewman</dc:creator>
      <dc:date>2006-02-01T15:49:10Z</dc:date>
    </item>
    <item>
      <title>a question</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/337044#M3081</link>
      <description>&lt;DIV&gt;hi everybody&lt;/DIV&gt;
&lt;DIV&gt;I have used waveformGraph in my code and I can show the data I give on the screen ok but does anyone know how I can get data that is shown on the screen anytime?&lt;/DIV&gt;
&lt;DIV&gt;I mean is there any function I can use the get the data of the waveformGraph?&lt;/DIV&gt;
&lt;DIV&gt;thank you&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Mar 2006 02:10:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/337044#M3081</guid>
      <dc:creator>shir</dc:creator>
      <dc:date>2006-03-12T02:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: a question</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/337077#M3082</link>
      <description>&lt;DIV&gt;Use WaveformPlot.GetXData() and WaveformPlot.GetYData() to obtain the data for a particular plot.&lt;/DIV&gt;</description>
      <pubDate>Sun, 12 Mar 2006 17:20:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/337077#M3082</guid>
      <dc:creator>drohacek</dc:creator>
      <dc:date>2006-03-12T17:20:16Z</dc:date>
    </item>
    <item>
      <title>thanks</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/340153#M3114</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;that really helped &lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2006 19:01:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/340153#M3114</guid>
      <dc:creator>shir</dc:creator>
      <dc:date>2006-03-18T19:01:51Z</dc:date>
    </item>
    <item>
      <title>Cursors in a WaveformGraph</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/345166#M3184</link>
      <description>&lt;DIV&gt;Hello everybody,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;I have used&amp;nbsp;cursors in the&amp;nbsp;waveformGraph but when I move the cursors (while I have a signal running on the waveformGraph) the signals stop moving no matter on what mode&amp;nbsp;the&amp;nbsp;cursurs are.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;is there a way I change the cursors position whitout interfering the signals plotting?&lt;/DIV&gt;
&lt;DIV&gt;I really appreciate ane help.&lt;/DIV&gt;
&lt;DIV&gt;thank you&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2006 17:16:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/345166#M3184</guid>
      <dc:creator>shir</dc:creator>
      <dc:date>2006-03-29T17:16:39Z</dc:date>
    </item>
    <item>
      <title>a question</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/345264#M3185</link>
      <description>&lt;DIV&gt;Hi everyone,&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;could anyone please tell me how I can make an exe file of my project ?&lt;/DIV&gt;
&lt;DIV&gt;thakx&lt;/DIV&gt;</description>
      <pubDate>Wed, 29 Mar 2006 19:18:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/345264#M3185</guid>
      <dc:creator>shir</dc:creator>
      <dc:date>2006-03-29T19:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: a question</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/346012#M3198</link>
      <description>Shir,&lt;BR /&gt;&lt;BR /&gt;Is your question how to distribute Measurement Studio applications, or simply how to build an exe.&amp;nbsp; If your project target is a Windows Application, then you should already have an executable that is built whenever you hit the Run button in Visual Studio.&amp;nbsp; Check your project files for a Debug or Release directory for the actual executable.&lt;BR /&gt;&lt;BR /&gt;If your question pertains to the distribution of Measurement Studio applications, there is a section in the Measurement Studio help that discusses deployment.&amp;nbsp; On the main Measurement Studio page there is a link to the Deploying Measurement Studio Applications help document.&lt;BR /&gt;&lt;BR /&gt;For future reference, you may have better luck if you post unrelated questions in new threads.&amp;nbsp; Many users may miss these questions because they are attached to an unrelated thread.&lt;BR /&gt;&lt;BR /&gt;Please let me know if you have any further questions.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Tyler Tigue&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 30 Mar 2006 23:42:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/346012#M3198</guid>
      <dc:creator>Tyler T.</dc:creator>
      <dc:date>2006-03-30T23:42:44Z</dc:date>
    </item>
    <item>
      <title>thanks</title>
      <link>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/346654#M3203</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;P&gt;Thanks Tyler&lt;/P&gt;
&lt;P&gt;I found the way.&lt;/P&gt;
&lt;P&gt;Thank you for the answer &lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2006 18:23:16 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/Measurement-Studio-for-NET/WaveformGraph-to-Image/m-p/346654#M3203</guid>
      <dc:creator>shir</dc:creator>
      <dc:date>2006-04-01T18:23:16Z</dc:date>
    </item>
  </channel>
</rss>

