JTable, Clipboard and charset encoding...

I'm trying to paste data into JTable. Here's a part of the code:
private BufferedReader getReaderFromTransferable(Transferable t)
throws IOException, UnsupportedFlavorException
if (t == null)
throw new NullPointerException();
DataFlavor[] dfs = t.getTransferDataFlavors();
for (int i = 0; i < dfs.length; i++)
System.out.println(dfs);
DataFlavor df = DataFlavor.selectBestTextFlavor(dfs);
df = df.getTextPlainUnicodeFlavor();
Reader r = df.getReaderForText(t);
return new BufferedReader(r);
When I'm copying data from Excel everything is fine because
DataFlavor of mimetype=text/plain...charset=utf-16le is supported.
However, if I try to copy and paste data only inside my JTable,
I'm getting UnsupportedFlavorException. It happens because
there are only two mimetype=text/plain supported none of which is
charset=utf-16le. API says that utf-16le is used for Windows as
default Unicode encoding. What am I supposed to do? How can I set
utf-16le encoding for my JTable? Or maybe I should do something
different.

Hi,
You dont have to set utf-16le encoding to JTable..instead you have to create your own flawor type which supports current encoding. I have some code example somewhere on my HD, but i'm too lazy to check it out. You can find examples of creating your own data flawor by putting "creating own data flawors" in search field in java.sun.com web site. This can be a really "bloodpath" but try to survive.

Similar Messages

  • Issue Using C# to Get RTF Text From Clipboard to Outlook With Formatting and Without Encoding Tags

    I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox.  A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
    and pasted into an Outlook Email.  When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it. 
    I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly.  This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
    formatting into the mail body.
    I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property.  In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
    work, I feel that I must be missing something really simple while trying to work with RTF.
    I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item.  This is bringing in all the RTF encoding tags.  I have tried to paste this directly into the RTFBody of the mail item,
    yet an execption gets thrown when executed.  Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it.  Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
    it will render properly.
    This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception.  Any help in the matter would be greatly
    appreciated.  I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
    Thanks for the help.
    Some pertinent information:
    Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
    Because of this Systems.Windows.Forms is not in use
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Pasting data into body of email
    myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
    myNewMailIoI.Display(); //Allow for window to be minimized
    myNewMailIoI.Display(true);

    Ok, I found the solution.  Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
    byte stream.  Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes. 
    This is where I failed to understand the previous answers.  I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
    misunderstanding) and that I needed to somehow take this byte array and do something with it.  My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
    after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray). 
    This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property.  Included below is the final code such that I hope that it helps some other
    person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
    using System.Text;
    using Outlook = Microsoft.Office.Interop.Outlook;
    private void buttonEmail_Click(object sender, RoutedEventArgs e)
    //Copy richTextBox information to Clipboard
    Clipboard.Clear();
    richTextBox.SelectAll();
    richTextBox.Copy();
    //Get current date to add to email subject line
    DateTime myNewDate = new DateTime();
    myNewDate = DateTime.Now;
    //Create Email
    Outlook.Application myNewApplication = new Outlook.Application();
    Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
    //Add Subject
    myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
    //Set Body Format to RTF
    myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
    //Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
    string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
    byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
    //Inserting RTF bytes into RTFBody property
    myNewMailIoI.RTFBody = myNewRtfBytes;
    myNewMailIoI.Display(); //Displays the newlycreated email
    //If this section is uncommented, it will add a properly formatted HTML text to the email
    //myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
    //myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>";

  • XML data - charset encoding problem

    Hello all,
      I am facing an issue on charset encoding. My requirement is to send an XML and read the the output XML to display the output. The output XML is encoded in "ISO-8859-1" and we are retrieving/reading it in "UTF-8". But some special characteres in the output XML are appearing as it is.
      Could some one let me know on how to obtain the desired characters.
    Code snippet while reading the XML:
    BufferedReader inStream = null;
    BufferedWriter outStream = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream(),"UTF-8"));
    inStream =
         new BufferedReader(new InputStreamReader(inputStream,"UTF-8"));
    Thanks & regards,
    Sharath

    Hi Sharath,
    To read the XML file use the following. Don’t mention the character set during reading it.I hope it will help you.
    XML file(emp.xml)
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Emp>
    <EmpDetails>
           <firstname>Sarbari</firstname>
           <lastname>Saha</lastname>
      </EmpDetails>
      <EmpDetails>
           <firstname>Tumpa</firstname>
           <lastname>Hazra</lastname>
      </EmpDetails>
    </Emp>
    Java File
    import java.io.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    import org.w3c.dom.NamedNodeMap;
    class ReadXML
         public static void main(String args[])
              try
                   String fileName="emp.xml";
                   DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
                   DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
                   Document doc = docBuilder.parse (fileName);
                   NodeList nodeList = doc.getChildNodes();
                   int nodeSize = nodeList.getLength();
                   for (int i=0;i<nodeSize;i++)
                        Node node = nodeList.item(i);
                        Element elm = (Element) node;
                        NodeList EmpDetailsList=elm.getElementsByTagName("EmpDetails");
                        int stNodeSize = EmpDetailsList.getLength();
                        System.out.println("NodeSize =  "+stNodeSize );
                        for(int j=0;j<stNodeSize;j++)
                                  Node nodeEmpdtl = EmpDetailsList.item(j);
                                  Element elmDetails = (Element) nodeEmpdtl;
                                  NodeList firstnameList=elmDetails.getElementsByTagName("firstname");
                                  NodeList lastnameList=elmDetails.getElementsByTagName("lastname");
                                  Node fnameNode=firstnameList.item(0);
                                  System.out.print("Node : " + fnameNode.getNodeName());
                                  System.out.println ("  Value : "+((Element)fnameNode).getChildNodes().item(0).getNodeValue());
                                  int lastnameNodeSize = lastnameList.getLength();
                                  Node lnameNode=lastnameList.item(0);
                                  System.out.print("Node : " + lnameNode.getNodeName());
                                  System.out.println("  Value : "+((Element)lnameNode).getChildNodes().item(0).getNodeValue());
              catch(ParserConfigurationException pce)
                   System.out.println("Inside ParserConfigurationException Exception");
              catch(SAXException se)
                   System.out.println("Inside SAXException Exception");
              catch(IOException ioe)
                   System.out.println("Inside IOException Exception");
    Regards,
    Mithu

  • How to set the charset encoding dynamically in JSP

    Is there any way to set the charset encoding dynamically in a JSP
    page?
    we are using weblogic 6.1 on HP unix.
    is there some way we can set the charset dynamically in the page directive
    <%@ page contentType="text/html;charset=Shift_JIS" %>
    and in MAET tag
    <meta http-equiv="Content-Type" content="text/html" charset="Shift_JIS">
    Saurabh Agarwal

    Dear Saurabh,
    I guess it is possible. Here is an example I have made some time ago :
    In my html page :
    <form name="form1" METHOD=POST Action=Lang ENCTYPE="application/x-www-form-urlencoded" >
    <p>
    <select name="code" size="1">
    <option value="big5">Chinese</option>
    <option value="ISO-2022-KR">Korean</option>
    <option value="x-euc-jp">Japanese</option>
    <option value="ISO-8859-1">Spanish</option>
    <option value="ISO-8859-5">Russian</option>
    <option value="ISO-8859-7">Greek</option>
    <option value="ISO-8859-6">Arabic</option>
    <option value="ISO-8859-9">French</option>
    <option value="ISO-8559-1">German</option>
    <option value="ISO-8859-4">Swedish</option>
    <option value="ISO-8859-8">Hebrew</option>
    <option value="ISO-8859-9">Turkish</option>
    </select>
    </p>
    <p>
    <textarea name="entree_text"></textarea>
    <input type="submit" name="Submit" value="Submit" >
    </p></form>
    and in my jsp :
    // Must set the content type first
    res.setContentType("text/html");
    code = req.getParameter("code");
    example = req.getParameter("entree_text");
    PrintWriter out = res.getWriter();
    // The Servlet send to the Browser the informations to format the language type
    out.println("<html><head><title>Hello World!</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset="+code+"\"></head>");
    // System recover the general Character encoding
    String reqchar = req.getCharacterEncoding();
    out.println("<body><h1>Hello MultiLingual World!</h1>");
    out.println("You have defined an ISO of : "+code);
    out.println("<BR>This is the code of the page that is displayed in this page<BR>");
    out.println("<BR>");
    out.println("<BR>");
    out.println("Character encoding of the page is : "+reqchar);
    out.println("<BR>This is the character code in the Servlet");
    out.println("<BR>");
    out.println("<BR>");
    out.println("<BR>");
    out.println("You have typed : "+example);
    out.println("<BR>");
    out.println("");
    out.println("</body></html>");
    I think starting from this example it is surely easy to modify dynamically the jsp.
    The other possibility would be to use the Weblogic Commerce and the LOCALIZE function, so that you'll have an automatic redirection to the right jsp-encoding depending on the customer's language.
    Feel free to reply on the forum for any related issue.
    Best regards
    Nohmenn BABAI
    BEA EMEA Technical Support Engineer
    "Saurabh" <[email protected]> a écrit dans le message de news: [email protected]...
    Is there any way to set the charset encoding dynamically in a JSP
    page?
    we are using weblogic 6.1 on HP unix.
    is there some way we can set the charset dynamically in the page directive
    <%@ page contentType="text/html;charset=Shift_JIS" %>
    and in MAET tag
    <meta http-equiv="Content-Type" content="text/html" charset="Shift_JIS">
    Saurabh Agarwal[att1.html]

  • Charset encoding of command-line arguments

    I have a java application which accepts a string from command line arguments like this
    java myapp <arguments>What will be the charset encoding of the arguments? It may contain some foreign characters.
    The default charset encoding of my JVM?? is windows-31j.
    System.out.println(Charset.defaultCharset().name());
    // output: windows-31jI need to convert the arguments into bytes array but i don't know what charset to specify in arguments.getBytes()?
    Please help.

    Kyowa wrote:
    I need to convert the arguments into bytes array but i don't know what charset to specify in arguments.getBytes()?
    Please help.The arguments are presented as String data, which should always be in UNICODE, regardless of the encoding used by the platform. There could be problems with conflict between the command line shell and the JVM with non-Latin characters, which would be a matter of configuration, but the string you get should be UNICODE.
    When you chose to convert a UNICODE string to a byte array or stream then you use whatever encoding you want the bytes to be in. In the Java model, it's characters stored as bytes which are encoded in various ways. The encoding encodes to and from the UNICODE characters used in Strings.

  • Charset encoding "in fly"

    Hi all!
    I have problem witch charset encoding. Currently I'm working on Oracle 7.1. All data in db were inserted using win1250 charset (via MS Access or smtng). Now I must present them on the Web using Linux+Apache+PHP but encoded in iso-8859-2 charset. And here is my problem.
    I dont know how to "translate" data from one charset to another. Does Oracle supports a "native" charset translation between server (Windows 1250) and client (ISO-8859-2) in both directions (select, insert, update, delete)?
    I have tried translate data "in fly" using iconv() function in PHP but it is "not so elegant" and too slow solution.
    I would be graceful for all yours suggestions.

    Oracle hasn't supported Oracle 7.1 in many, many years, so I have no idea whether it works completely differently from current versions... I'll describe how this works in modern versions of Oracle.
    What are your client and database character sets? Assuming you're properly identifying the data coming in as Windows 1250, the Oracle database automatically converts the data to the database's encoding. When the data is retrieved, it is automatically converted to the character set of the client (assuming such a conversion is possible).
    I would note that Windows-1250 and ISO-8859-2 are not completely compatible character sets-- both contain characters that do not appear in the other-- so it may not always be possible to convert the data in all cases.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • I am trying to take a picture of a web page and paste on a one drive powerpoint. I tryed pressing the print screen button, and pasting. But it is giving me message saying that my browser can not fine the clipboard, and I need to use the keyboard shortcuts

    I need to take a picture of a web page, insert it onto a powerpoint online, and crop the picture. I am pressing the print screen button, and right cliking paste. But I am getting the warning message saying that my browser can not use the clipboard, and I am unsure of how to take a picture, then paste it, and crop it all on to a power point.

    http://portableapps.com/apps/internet/firefox_portable/localization#legacy36

  • Problems installing Bridge and Media Encoder in CS6

    I recently installed Creative Suite CS6 Design & Web Premium. I had previously installed the CS5 version and had not un-installed it. Everything except Acrobat appeared to install correctly. When I opened Photoshop CS6 (64-bit) I noticed that it used the CS5 version Bridge. I went into Bridge and unchecked the open at start box, closed Bridge and Photoshop and re-opened Photoshop CS6 (64-bit). When I tried to lunch Bridge from Photoshop the following message appeared in the Desktop> panel : Waiting for Bridge CS6..." Bridge CS6 did not appear despite waiting for several minutes. I then pressed the Start button and went into the Programs listing. Under the Adobe CS6 group I found all of the applications (other than Acrobat) but Bridge CS6 (64-bit), Bridge CS6, and Media Encoder each had generic icons rather than the expected relevant Adobe icons. I tried to load each of the three by clicking on the icon. In each instance the following message appeared:
    The version of this file is not compatible with the version of Windows you are running. Check your computer's system information to see whether you need an x86 (32-bit) or x64 (64-bit) version of the program and then contact the software publisher.
    My system is a Gateway FX6802. I am running Windows 7 Home Premium version 6.1.7601, Service Pack 1, Build 7601. The system has 9 GB of memory. I ran CS5 on the system and did not experience any difficulty with Bridge.

    Thanks. Being the impatient sort (inspite of the problems that can create) I only did a partial uninstall with the cleaner tool, taking out the three items that were not working. Initially that seemed not to work. As I had other non-Adobe projects to take care of I put it out of mind. I even let an updatee package do its wonders. Today I used Photoshop for a quick project. I clicked on the Launch Bridge button and lo and behold the proper icon showed up and Bridge loaded. After finishing my project I closed down Photoshop and Bridge and then went through updating once more. The other problem I was having was with Acrobat. I finally traced the problem to a bad installation of Acrobat 9 at the CS4 level. (Shows you how much I use Acrobat.) I used the cleaner tool to clean up the remnants of CS4. After that Acrobat X installed quite nicely. At this point everything seems to be working as it should. Thanks for your help.

  • Premiere pro and media encoder CC problem

    Hi guys,
    I hope some of you can help me, I installed new version of premiere pro and media encoder CC and now none of them works, I can edit in premiere but as soon as I press export message apears ''sorry a serious error has occurred that requires adobe premiere to shut down'' when I try to open encoder it shut down on startup.
    I'm using old IMac 2.4ghz intel core duo, 2gb 667 mhz ddr2 sdram, ATI Radeon HD 2600 Pro 256 MB, OS X 10.8.5.
    This is the error report, please help:
    Process:    
    Adobe Media Encoder CC [946]
    Path:       
    /Applications/Adobe Media Encoder CC/Adobe Media Encoder CC.app/Contents/MacOS/Adobe Media Encoder CC
    Identifier: 
    com.adobe.ame.application
    Version:    
    7.2.0.43 (7.2.0)
    Code Type:  
    X86-64 (Native)
    Parent Process:  launchd [136]
    User ID:    
    501
    Date/Time:  
    2014-02-10 08:44:28.001 +0100
    OS Version: 
    Mac OS X 10.8.5 (12F45)
    Report Version:  10
    Interval Since Last Report:     
    1264 sec
    Crashes Since Last Report:      
    1
    Per-App Interval Since Last Report:  24 sec
    Per-App Crashes Since Last Report:   1
    Anonymous UUID:                 
    7E711766-8C55-00D3-811F-852F73421407
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Exception Type:  EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Application Specific Information:
    terminate called throwing an exception
    abort() called
    Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
    0   libsystem_kernel.dylib   
    0x00007fff9483c212 __pthread_kill + 10
    1   libsystem_c.dylib        
    0x00007fff8d74ab24 pthread_kill + 90
    2   libsystem_c.dylib        
    0x00007fff8d78ef61 abort + 143
    3   libc++abi.dylib          
    0x00007fff96ff79eb abort_message + 257
    4   libc++abi.dylib          
    0x00007fff96ff539a default_terminate() + 28
    5   libobjc.A.dylib          
    0x00007fff8f49d887 _objc_terminate() + 111
    6   libc++abi.dylib          
    0x00007fff96ff53c9 safe_handler_caller(void (*)()) + 8
    7   libc++abi.dylib          
    0x00007fff96ff5424 std::terminate() + 16
    8   libc++abi.dylib          
    0x00007fff96ff658b __cxa_throw + 111
    9   com.adobe.dvacore.framework  
    0x000000010022814d dvacore::filesupport::DirHelper::Create() + 813
    10  com.adobe.AMEAppFoundation.framework
    0x0000000104f285e9 AME::foundation::AppUtils::GetUserPresetDir(bool) + 425
    11  com.adobe.Batch.framework
    0x0000000105c0a842 AMEBatch::Initialize() + 2194
    12  com.adobe.ame.application
    0x00000001000273cb AME::app::AMEAppInitializer::AMEAppInitializer(exo::app::AppInitArgs&, std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> >&) + 811
    13  com.adobe.ame.application
    0x000000010000ad6a AME::app::AMEApp::InitApplication(exo::app::AppInitArgs&) + 2426
    14  com.adobe.exo.framework  
    0x000000010513e77a exo::app::AppBase::Initialize(exo::app::AppInitArgs&) + 1066
    15  com.adobe.ame.application
    0x00000001000141a8 AME::RunTheApp(exo::app::AppInitArgs&, std::vector<std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> >, std::allocator<std::basic_string<unsigned short, std::char_traits<unsigned short>, dvacore::utility::SmallBlockAllocator::STLAllocator<unsigned short> > > >&) + 1576
    16  com.adobe.ame.application
    0x0000000100056a38 main + 424
    17  com.adobe.ame.application
    0x0000000100003f74 start + 52
    ==========================
    Edited by moderator to trim the crash report down to the essentials. Since these forums do not support attaching file (due to legal and security issues), we recommend uploading files using Acrobat.com’s Sendnow (https://sendnow.acrobat.com) or similar services (YouSendit.com, etc.)

    Hi mawe81,
    Thanks for posting on Adobe forums,
    Please follow this document  http://adobe.ly/1f2EHCg
    and let us know if this fix your issue or not.
    Regards,
    Sandeep

  • Saving image in windows 8.1 using stream and bitmap encoder id

    Hi
    var renderTargetBitmap = new RenderTargetBitmap();
    await renderTargetBitmap.Render(myElementTree);
    var pixels = await renderTargetBitmap.GetPixelsAsync();
    var picker = new FileSavePicker();
    // Picker setup
    var file = await picker.PickSaveFileAsync();
    // File validation
    using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
    var encoder = await
    BitmapEncoder.CreateAsync(BitmapEncoder.BmpEncoderId, stream);
    encoder.SetPixelData(BitmapPixelFormat.Rgba8, 100, 0, 96, 96,
    await renderTargetBitmap.GetPixelsAsync());
    await encoder.FlushAsync();
    I have already used the code snippet. Could you please tell me how to save UIElement tree by having the stream and bitmap encoder id as input?
    Thanks
    Satheesh

    Here you go. Set up the file picker and call our CaptureElementToFile function. In this case it's passing the page to capture the whole screen:
    FileSavePicker picker = new FileSavePicker();
    picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
    picker.SuggestedFileName = "capture.bmp";
    picker.FileTypeChoices.Add("Bitmap File",new List<string>() { ".bmp" });
    StorageFile file = await picker.PickSaveFileAsync();
    CaptureElementToFile(this, file);
    And here's CaptureElementToFile. The BitmapEncoder needs to know information about the size and shape of the pixel buffer and it needs to have the pixels as an Array. If you want to encode to a different size you can include a BitmapTransform.
    async void CaptureElementToFile(UIElement element, StorageFile file)
    RenderTargetBitmap renderTargetBitmap = new RenderTargetBitmap();
    await renderTargetBitmap.RenderAsync(element);
    IBuffer pixelBuffer = await renderTargetBitmap.GetPixelsAsync();
    DisplayInformation dispInfo = DisplayInformation.GetForCurrentView();
    using (var stream = await file.OpenAsync(FileAccessMode.ReadWrite))
    var encoder = await BitmapEncoder.CreateAsync(BitmapEncoder.BmpEncoderId, stream);
    encoder.SetPixelData(BitmapPixelFormat.Rgba8, BitmapAlphaMode.Straight,
    (uint)renderTargetBitmap.PixelWidth,
    (uint)renderTargetBitmap.PixelHeight,
    dispInfo.LogicalDpi,dispInfo.LogicalDpi,
    pixelBuffer.ToArray());
    await encoder.FlushAsync();
    --Rob

  • Using Premiere CC and Media Encoder CC at the same time

    Is this possible?  Doesn't seem to be.  Media Encoder bails on every job as soon as you try to render anything in Premiere.  I guess they don't play nice together, which is surprising.  I was hoping that Media Encoder would pause and wait for Premiere to finish a render.  Instead it dies on every render job, creating 0 size video files... while making a sheep bleating sound.
    Is this a GPU issue?  I have 2 nVidia cards, a 770GTX and 560GTX. (Windows 8.1, 16gb RAM, 3770k CPU)

    As soon as I initiate a render in Premiere, Media Encoder bleats, and all subsequent render jobs bleat and produce 0 size video output files... even if I quit the Premiere render before Media Encoder reaches some of those render jobs.
    I suspect this is a GPU sharing issue.... but can't be certain.
    What do you mean by new install?  Did I install it (AME or Premiere) recently? No.  I've had Creative Cloud on my machine for almost a year, and both Premiere and Media Encoder have been updated periodically.
    To my knowledge they have never worked together, but I only started using the queue feature within Premiere recently, so I haven't used AME until recently.

  • Premiere Pro and Media Encoder crash while rendering H.264

    Very recently, a problem's popped up where Premiere Pro and Media Encoder (CC) will crash while rendering H.264.
    It's only while rendering H.264 - other formats seem to work fine.
    And I don't mean that it returns an error, I mean it hard crashes with a Windows "Adobe Premiere Pro CC has stopped working" popup.
    It doesn't crash at a consistent time during the render, even on the same project. Occasionally, it won't crash at all, but this is usually not the case.
    I've tried disabling CUDA and my overclock to no avail. Please help!

    On the topic of opening a project on the exact same version of Premiere Pro CC 2014 (yes it is definitely up to date, and the 2014 version), to overcome this export crash problem that ZachHinchy has brought up - you can't. Technically speaking, one should easily be able to open a Premiere Pro CC 2014 project from one system on another system running the exact same up to date, legitimate version of Premiere Pro CC 2014 without any kind of error. But for some reason, this has been disallowed(?) by Adobe. It has facepalm written all over it. Does anyone agree that this is at least a little bit silly?
    I have tried exporting a Final Cut Pro XML from my project to try and open the sequence at uni on a Mac, so I can render my project when I finish my edit. It half works - the clips are there, but the sequence is gone - i.e. 12 hours of painstaking sequencing and micro-edits that had me at several points in time wanting to insert my hand through my monitor with enough force to make a large hole. I really cannot afford redo this sequence, as my assignment is due tomorrow, and I have to work at 6 oclock in the morning, so I also cannot afford to stay up till the early hours of tomorrow morning. Wish me luck that some miraculous event has taken place overnight that will somehow allow me to just open my project, on the same version of Premiere, on a Mac, without hassle. (Apple OS is not friendly to anything but its own selfish nature, so I am having doubts).
    Adobe please, if you can do anything at all to help, you will save my assignment, and my faith will be restored. Otherwise, I'll just get my money back and buy Final Cut instead.
    I cant even
    If I find a way to fix either of these problems, I will post straight away.

  • Premiere and Media Encoder - h264 corrupted encode

    Hello all
    I'm writing here since I simply cannot find a solution to my problem, recently out of a sudden my adobe premiere and Media encoder have been giving me corrupt h264 encodes, the files apparently encode but adobe does not put them in a container. The .m4v file is unplayable and the same goes for the audio file; here is a sample from MediaInfo:
    No matter what sequence or project I try to encode with h264 this happens while I can encode to any other extension/codec with no problems. While using the same project file and the same source files on another computer the encodes finishes without a problem. Even a simple timelapse with just JPEG pictures on the timeline results in this problem. I have no idea what to do but I simply cannot encode with anything else so any help is appreciated (P.S. the 4k resolution here is a timelapse, most encodes I try to do are 1080p @ 25fps, since most people bump at this resolution 1st)
    I'm running Adobe Premiere Pro CS6 (6.0.5) updated to the latest on Windows 7 64bit.

    Hello all
    I'm writing here since I simply cannot find a solution to my problem, recently out of a sudden my adobe premiere and Media encoder have been giving me corrupt h264 encodes, the files apparently encode but adobe does not put them in a container. The .m4v file is unplayable and the same goes for the audio file; here is a sample from MediaInfo:
    No matter what sequence or project I try to encode with h264 this happens while I can encode to any other extension/codec with no problems. While using the same project file and the same source files on another computer the encodes finishes without a problem. Even a simple timelapse with just JPEG pictures on the timeline results in this problem. I have no idea what to do but I simply cannot encode with anything else so any help is appreciated (P.S. the 4k resolution here is a timelapse, most encodes I try to do are 1080p @ 25fps, since most people bump at this resolution 1st)
    I'm running Adobe Premiere Pro CS6 (6.0.5) updated to the latest on Windows 7 64bit.

  • Upgraded to CC 2014 and Media Encoder doesn't work now.

    Using a mac with mavericks, all updated. Upgraded to Premiere Pro CC 2014 and Media Encoder CC 2014. But when I want to launch it... it won't open.
    Help?

    JUST FOR MAC USERS - Some 10.9.3 links
    -next link says After Effects, but check YOUR permissions !!!
    -http://blogs.adobe.com/aftereffects/2014/06/permissions-mac-os-start-adobe-applications.ht ml
    -Mac 10.9.3 workaround https://forums.adobe.com/thread/1489922
    -more Mac 10.9.3 https://forums.adobe.com/thread/1491469
    -Enable Mac Root User https://forums.adobe.com/thread/1156604
    -more Root User http://forums.adobe.com/thread/879931
    -and more root user http://forums.adobe.com/thread/940869?tstart=0
    -Mac 10.9.3 and CS6 https://forums.adobe.com/thread/1480238

  • Premier Pro CC and Media Encoder crashing on long file export.

    Please forgive the length of this inquiry. But it is complicated and has a lot of variables.
    I have an hour long mixed format timeline both Red 3K footage and Black Magic ProRes 1080P footage that I want to make a DVD from and it takes forever and crashes half way through. I have tried doing it every way possible and the only way I was able to get even a partial export was using the "MPEG 2 DVD" export option in Premier CC. It goes fast at first telling me it will take about 2 hours but even though it starts quickly doing about 15 fps it slows down to less than 1 fps and finally just stops and crashes my Cuda Core enabled Macbook Pro Laptop.
    I really don't know who to ask about this since there are so many different variables. I never had a problem like this on my MBP with PP6 on a 4K timeline exporting to DVD or Blue Ray or to H-264 or Even Prores. But I wasn't mixing formats either. But on this project the first 20-30 minutes of footage goes through fine in a couple of hours but something seems to be bogging down the system on longer projects. My work around was to break the project up into multiple exports and combining them on the DVD timeline but I can't do this on every project. I thought maybe it was a corrupted clip somewhere in the timeline but when I broke the timeline up into several parts I had no problems.
    I did notice a dramatic variance in the time it took to export footage based on the sequence settings. A one minute timeline comprised Red 3K footage and ProRes 1080P footage Here are some sample export results:
    From a Red raw 3K timeline 2880x1620  with 1080P Prores footage upscaled 150%)
    to .m2v Mpeg 2 720x480 format    1:48 Minutes ***
    to .mov  Prores 422HQ  1080P                         22 Minutes
    to .mov H.264  1080P                    22 Minutes
    to .m2v Mpeg 2 1080P                                                22 Minutes
    From a 1080P timeline Prores footage at 100%  (Red footage downscaled to 67%)
    to .m2v Mpeg 2 720x480 format                         13 Minutes
    to .mov  Prores 422HQ 1080P                             13 Minutes
    to .mov H.264  1080P                                                             14 Minutes
    to .m2v Mpeg 2 1080P                                                            14 Minutes
    Since I am going to DVD,  I chose the fastest option  Red to m2v Mpeg 2 720x480 format which only took 1:48 per minute. Why? I have no idea. Maybe someone here knows the answer. But again these numbers are for a ONE MINUTE clip when I tried to convert the whole hour timeline to  the 720x480.m2v DVD File the Red timeline froze my computer after several hours even though I had set sleep mode to “Never” and turned the display off manually and I had to convert it in multiple chunks. In 20-30 minute chunks it did go fast about 1:48 per minute like the test indicated. But I would like to be able to convert the whole hour and not to have to try to stitch the clips together in my DVD authoring program.
    I don’t want to have to avoid using multiple formats on the same timeline or waste time transcoding everything to the same format.
    Can anyone give me any suggestions as to why the computer is crashing or bogging down in long exports and what timeline settings I should be using?
    I have plenty of room on my Scratch Disk and 8 Gig of RAM and according to my Activity Monitor during the export process  have about 800 Meg of System Memory during export but the CPU Usage is 98% and in my Activity Monitor I see under “Process Name” ImporterRedServer flashing up at the top of the list about every second during export.
    Why .720x480 mpeg DVD setting is so much faster than all the other export codecs?
    And if there are any other settings I can use to get higher speed exports in HD? 14x1 seems a little slow especially since every time it crashes I have to start over.

    Hi,
    Since a long time I did not encounter the crash of Media encoder with
    long file export.
    But I take care of a lot of details before the export :
    - clean up Media cache and Media Cache Files within PP CS6 and/or CC,
    - delete all render files with Preview Files,
    - rendering of sequences until the rendering is completed,
    - PP CS6 and/or Pp CC opened during export to AME and/or Encore CS6,
    I guessed to leave Adobe but this company remains the last with a
    serious authoring software (Encore CS 6).
    I tested :
    - Avid Media Composer, Final Cut Pro X, both are very good software but
    no really authoring software for these video editing softs.
    Th only way is to "flood" Adobe with "bug reports" and "wish forms"
    which are not very easy to use.
    And also to call the Adobe support day by day until they send they
    escalate the bug.
    Le 16/05/2014 16:51, alainmaiki a écrit :
    >
          Premier Pro CC and Media Encoder crashing on long file export.
    created by alainmaiki <https://forums.adobe.com/people/alainmaiki> in
    /Premiere Pro/ - View the full discussion
    <https://forums.adobe.com/message/6384665#6384665>

Maybe you are looking for

  • Photoshop CS3 tries to open tif and jpgs as RAW?

    While the problem looks like a PS3 issue, I believe it is somehow related to LR, so I will ask here. When I try to open some of my saved TIF and JPG files back into Photoshop CS3, it often brings the files into the Adobe Camera Raw converter instead

  • SAve as a Word / PDF document

    Hi, I have a JSP web application. This application has several user forms to be filled in by the user. The forms are developed using JSP and Java codes. Right now, I am able to print the forms through the application. I would need to save these forms

  • Sony Handycam

    Got a Sony Handy Cam with USB connection, is it posible to import video rom this cam into Final Cut ot do I need I cam with a fire wire connection ? Thanks

  • Upload data from omronbp9112t

    can't upload from Omron bp911T monitor into health vault.

  • Re-install Final Cut Studio 1 Probs with old fcp files and compressor

    We crashed our G5 and reinstalled OSX 10.4.8 (Build 8N1430) and FC Studio 1 from original media. In the past (not now) the G5 was connected to the internet and was set to auto-update. I'm assuming and have been told by those working with the system a