<?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 Oops... (I really wish we… in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60103#M13632</link>
    <description>Oops... (I really wish we could edit posts)
LoadBinaryFile(""C:\Test\image.png"")</description>
    <pubDate>Tue, 19 Feb 2019 01:59:00 GMT</pubDate>
    <dc:creator>david.l.morris</dc:creator>
    <dc:date>2019-02-19T01:59:00Z</dc:date>
    <item>
      <title>How to save image data type (Data item) to desktop folder png format?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60101#M13630</link>
      <description>I have an image data type&amp;nbsp;(Data item) . I want to save this file to desktop folder. How can it be?</description>
      <pubDate>Mon, 18 Feb 2019 23:54:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60101#M13630</guid>
      <dc:creator>ÖzençGezgin</dc:creator>
      <dc:date>2019-02-18T23:54:00Z</dc:date>
    </item>
    <item>
      <title>I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60102#M13631</link>
      <description>I'll probably facepalm after I ask this question. How did you get the image into the image data item to begin with (other than importing through BP's UI? If you're just trying to pull an image into Blue Prism and hold it for a while and then save it somewhere later on, you can use a binary data item instead. Use a Calculation stage with the function LoadBinaryFile([C:\Test\image.png]) to get it into a binary data item. Then use the File Management VBO's action 'Write Binary Data' to write it to another location.
Of course, I'm assuming that (1) simply moving the file isn't good enough and (2) you don't need to use the image while in transit.</description>
      <pubDate>Tue, 19 Feb 2019 01:58:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60102#M13631</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-19T01:58:00Z</dc:date>
    </item>
    <item>
      <title>Oops... (I really wish we…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60103#M13632</link>
      <description>Oops... (I really wish we could edit posts)
LoadBinaryFile(""C:\Test\image.png"")</description>
      <pubDate>Tue, 19 Feb 2019 01:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60103#M13632</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-19T01:59:00Z</dc:date>
    </item>
    <item>
      <title>I have the same problem…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60104#M13633</link>
      <description>I have the same problem.Meybe you did&amp;nbsp;not understand us.For example.I have a Data Item with type 'image' named 'imagedata'.This image is not imported but from dynamic by Region Mode(Surface Automation).Then how to save this variable to local folder. There is no function'&amp;nbsp;LoadBinaryFile' in a calculation stage.Can you help me? Thanks.</description>
      <pubDate>Wed, 27 Feb 2019 17:05:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60104#M13633</guid>
      <dc:creator>HuYue</dc:creator>
      <dc:date>2019-02-27T17:05:00Z</dc:date>
    </item>
    <item>
      <title>Hi huyue,
There is a…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60105#M13634</link>
      <description>Hi huyue,
There is a function in a calc stage called 'LoadBinaryFile'. Check the File group of functions. But that function doesn't apply to what you need.
If you've got an image in a data item that you want to save, I don't know of an existing function or action for that. However, it seems as though writing code for this is pretty easy. I don't know what format you need, so it may be slightly different for you. Below works for me (C#):

varImage.Save(saveLocation,ImageFormat.Png);

That's with 'varImage' being an input variable to your code stage and you pass in your image data item.
And 'saveLocation' is something like 'C:\Test\fileName.png'.
Dave
&amp;nbsp;
&amp;nbsp;</description>
      <pubDate>Wed, 27 Feb 2019 17:39:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60105#M13634</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-27T17:39:00Z</dc:date>
    </item>
    <item>
      <title>Also, I had to add the…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60106#M13635</link>
      <description>Also, I had to add the Namespace Import of 'System.Drawing.Imaging' so that the Compiler would be happy.</description>
      <pubDate>Wed, 27 Feb 2019 17:41:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60106#M13635</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2019-02-27T17:41:00Z</dc:date>
    </item>
    <item>
      <title>RE: Hi huyue,
There is a…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60107#M13636</link>
      <description>Thanks &lt;A class="user-content-mention" data-sign="@" data-contactkey="ae9fdab1-2d26-46c7-9f20-a84e446d45c9" data-tag-text="@Dave Morris" href="https://community.blueprism.com/network/profile?UserKey=ae9fdab1-2d26-46c7-9f20-a84e446d45c9" data-itemmentionkey="1b1e3557-9bee-4854-a39c-fbadbec51476"&gt;@Dave Morris&lt;/A&gt;-- This works .. I am trying to save different images from a PDFs as separate pngs​ and this helped&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Harshit Rawat&lt;BR /&gt;Senior RPA Consultant&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2021 12:09:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60107#M13636</guid>
      <dc:creator>HarshitRawat</dc:creator>
      <dc:date>2021-04-28T12:09:00Z</dc:date>
    </item>
    <item>
      <title>RE: Hi huyue,
There is a…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60108#M13637</link>
      <description>Awesome! Glad it helped!&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dave Morris&lt;BR /&gt;Cano Ai&lt;BR /&gt;Atlanta, GA&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Apr 2021 19:34:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60108#M13637</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2021-04-28T19:34:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60109#M13638</link>
      <description>Hi Dave,&lt;BR /&gt;&lt;BR /&gt;Just for another way this can happen. It's possible to read an image when you've spied it using surface automation, just grab a read stage and select "Read Image".&lt;BR /&gt;&lt;BR /&gt;I had to use this a lot in v5 for image matching, but you never know when something like this may come in use!&lt;BR /&gt;&lt;BR /&gt;I would imagine to save it down, you'd need to "write" it into an image editing application as there's no internal functionality to save an image. Would be interested to hear if you can think of a way to do this though.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ben Lyons&lt;BR /&gt;Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2021 09:33:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60109#M13638</guid>
      <dc:creator>Ben.Lyons1</dc:creator>
      <dc:date>2021-04-29T09:33:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60110#M13639</link>
      <description>Yeah it works to just save by using the File Management VBO's action 'Write Binary Data' and include the image extension such as .png or whatever. I said that stuff over two years ago so I don't even remember typing that stuff. Haha! But yeah image files typically are binary data (not sure if all image types are or not) and they can be just written to the disk with the right file extension and then it'll display if you were to open it.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dave Morris&lt;BR /&gt;Cano Ai&lt;BR /&gt;Atlanta, GA&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Thu, 29 Apr 2021 17:59:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60110#M13639</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2021-04-29T17:59:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60111#M13640</link>
      <description>Nice one, so basically a method that could also be used to take screenshots to some degree. Surface Automation to read images (can be set to location based to ignore what the image is) and then write binary to save.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ben Lyons&lt;BR /&gt;Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Apr 2021 07:01:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60111#M13640</guid>
      <dc:creator>Ben.Lyons1</dc:creator>
      <dc:date>2021-04-30T07:01:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60112#M13641</link>
      <description>Hi &lt;a href="https://community.blueprism.com/t5/user/viewprofilepage/user-id/15488"&gt;@Ben.Lyons1&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;I went back and re-read what you were saying. I see that you were talking about taking an actual image data item and saving that to the disk. What I suggested doesn't work directly for that. Just wanted to follow up and say that yeah it cannot be directly saved. You'd have to convert from Image to Binary first.&lt;BR /&gt;&lt;BR /&gt;I grabbed some code from Stack Overflow to test it just in case and it works: ​https://stackoverflow.com/questions/3801275/how-to-convert-image-to-byte-array&lt;BR /&gt;&lt;BR /&gt;I did adjust the code slightly because I'm lazy. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; (I added static so I didn't have to instantiate an object when using it)&lt;BR /&gt;&lt;BR /&gt;Here's the Global Code:&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;public static byte[] ImageToByteArray(System.Drawing.Image imageIn)
{
   using (var ms = new MemoryStream())
   {
      imageIn.Save(ms,imageIn.RawFormat);
      return  ms.ToArray();
   }
}​&lt;/CODE&gt;&lt;/PRE&gt;
​&lt;BR /&gt;And then here's what would be in a code stage, assuming an input parameter of ImageIn and an output parameter of BinaryOut&lt;BR /&gt;
&lt;PRE class="language-csharp"&gt;&lt;CODE&gt;BinaryOut = ImageToByteArray(ImageIn);​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And in case anyone is trying this who isn't familiar with programming, be sure to add Namespace imports in the Initialise page &amp;gt; Properties &amp;gt; Code Options &amp;gt; Namespace Imports. For this, you should only have to add System.IO for the MemoryStream. No additions needed in External References.&lt;BR /&gt;&lt;BR /&gt;Edit: Also in case it's not obvious, at this point, the Utility - File Management VBO's action 'Write Binary Data' can be used to write the binary data to the disk. Use the file extension such as .png in the name of the new file. And then the image should be viewable.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Dave Morris&lt;BR /&gt;Cano Ai&lt;BR /&gt;Atlanta, GA&lt;BR /&gt;------------------------------&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 13:14:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60112#M13641</guid>
      <dc:creator>david.l.morris</dc:creator>
      <dc:date>2021-05-03T13:14:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60113#M13642</link>
      <description>Nice one. Looks good.&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Ben Lyons&lt;BR /&gt;Product Consultant&lt;BR /&gt;Blue Prism&lt;BR /&gt;UK&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Tue, 04 May 2021 07:15:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60113#M13642</guid>
      <dc:creator>Ben.Lyons1</dc:creator>
      <dc:date>2021-05-04T07:15:00Z</dc:date>
    </item>
    <item>
      <title>RE: I'll probably facepalm after…</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60114#M13643</link>
      <description>Hi Dave,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;That worked great.&amp;nbsp; Initially, we had a Data Item of type Image, and didn't readily see a way to Write it out to a file using a VBO.&lt;BR /&gt;&lt;BR /&gt;Once we updated the logic such that the Screen Shot that were were working with was in a Data Type of Binary, then, as you pointed out, we could simply use the Utility File Mgmt VBO, Write Binary Data Action to write it out to a file.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;Thanks&lt;BR /&gt;&lt;BR /&gt;------------------------------&lt;BR /&gt;Kevin Wilson&lt;BR /&gt;`Solution Engineer&lt;BR /&gt;Blueprism&lt;BR /&gt;America/Denver&lt;BR /&gt;------------------------------&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jul 2022 16:23:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-save-image-data-type-Data-item-to-desktop-folder-png/m-p/60114#M13643</guid>
      <dc:creator>kevin.wilson</dc:creator>
      <dc:date>2022-07-20T16:23:00Z</dc:date>
    </item>
  </channel>
</rss>

