How to save FrameworkElement as very large raster image?

I have to save my FrameworkElement as
very large raster image. For now I use the RenderTargetBitmapclass
and a BitmapEncoder,
in this way:
RenderTargetBitmap bmp = new RenderTargetBitmap(ElementWidth, ElementHeight,
     90, 96, PixelFormats.Default);
bmp.Render(MyElement);  // OutOfMemoryException here
PngBitmapEncoder encoder = new PngBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bmp));
using (var stream = File.Create(filePath))
{ encoder.Save(stream); }
Where ElementWidth and ElementHeight are large numbers (about 10000x6000). But with this solution there's a OutOfMemoryException when i try to Render my
element.
There are other ways to do what I need (without causing an OutOfMemoryException)? Thanks.

Following link may help you
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/c5e31d70-08d1-4402-8016-0a0b7af49b04/
Gaurav Khanna | Microsoft VB.NET MVP

Similar Messages

  • ALV: how to save context space for large tables ?

    Dear collegues,
    We are displaying an ALV table that is quite large. Therefore, the corrsponding DDIC structure and the WD context is large. This has an impact on performance and the load size of the program. Now we will enhance the ALV table again.
    Example: for an icon and its explaining tooltip that are displayed in the ALV: there is are context fields required like "SOURCE_FIELDNAME" for the tooltip as well as for for the icon. They need a lot of characters for each tooltip and icon).
    Question: do you have an idea, how to save context space for those ALV fields ?
    Best regards,
    Christian

    >We are displaying an ALV table that is quite large.
    Do you mean quite large as in a large number of columns or as in a large number of rows (or both)?  I assume that the problem is probably more related to a large number of rows.  For very large tables, you should consider using the table instead of the ALV. For very large tables you can even use a technique called context paging to keep only a subset of the data in the context memory at a time.  Here is a recent blog that I created on the topic with demonstrations of different techniques for table sharing, shared memory, and context paging when dealing with large tables in Web Dynpro ABAP:
    Web Dynpro ABAP: How Fast Can You Consume 1 Million Rows?

  • How to save 4 artboards as 1 JPG image in Adobe Illustrator?

    I am doing an online class for fundamentals of design.
    I had to create 4 different designs, so I did this by doing them on 4 different artboards.
    I need to save my work for "web and devices..." as a JPG image in Adobe Illustrator (this i can do). But I want to save this assignment as 1 JPG image with all four artboards showing on one image.
    Can anyone tell me how to do this step by step.
    Thanks so much!!!
    Oh I am using Adobe Illustrator CS5.1

    Make a new artboard by selecting the Artboard tool and shift-click where you want it to start, then drag it out to cover all four of the images.

  • How can I copy a very large iMovie file (10.08 GB) onto a disc?

    I have an imovie project of my daughters wedding and I would like to put it on a disc for her, however, it is so big ( 10.08GB) that I can't find a DVD disc big enough. I bought a 16GB USB drive thinking I could copy it to that but my iMac says that it is too big to copy. Can anyone help please?
    Also is it possible to save an imove file as a different type of file? if so, how do i do it?

    If you want your daughter to be able to play the movie in a DVD player, you need DVD authoring software. Get a copy of iDVD (discontinued but you can still find copies of the old iLife09 or iLife11 package that include iDVD) or Roxio Toast.
    Export your iMovie project to a QuickTime movie file, then import the resulting QT movie into iDVD or Toast and create your DVD.  They will encode & compress your movie to fit on a DVD and be playable in a DVD player.
    Note: you can fit up to about 2 hours of video on a single-layer DVD disk and up to about 4 hours on a dual-layer DVD disk.  The iMovie project file size is not the correct measure here, the length in time of the video is.

  • How do I split a very large RH8 project?

    Hi,
    I need to split a large RH8 (webhelp) project with about 10,000 files. There is no logical way to divide the contents, the topics are all intertwined. However, there is one folder that contains 3000+ files.
    Have anyone split a large project like this? Appreciate any tips, best practices or suggestions.
    Thanks, Hemtya

    Hi Hemtya. I've always tried to avoid getting into this situation but I'd do the following:
    Think carefully how you'd divide the project - maybe by folder is a good way although I'd also divide the 3000 file folder also.
    Create another project to act as a Master into which all the others are merged.
    Copy the project to a new directory, open RH and delete unwanted topics (e.g. by folder).
    There is lots of other stuff to consider (e.g. path links) but how you tackle these things depends on your output type. If you tell us that, we'll be able to point you to some other resources.
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • How to save memory when processing large result set

    I need to dump multi millions of rows of data into excel files
    I query the tables and open excel to write in
    The problem is even I chopped the result into hundred files, close excel completely after 65536 rows, the memory usage keeps going up as the result set is looped and at one point hit the heap size
    How can I release the memory has been used in the result set?
    Thank you

    mycoffee wrote:
    936517 wrote:
    I think resultSet.close() will do what you want (you shouldn't have to set resultSet=null when you're done with it).
    You can't force the garbage collector to run and reclaim memory. It uses an intelligent algorithm to do so .
    I question why your project is sending millions of records to excel. Who is going to read a 10,000 page excel document(s)?
    Instead, I suggest you provide a (intelligent) filter mechanism to allow users to get a subset of data to send to an excel document rather than all data. For example: instead of sending him the entire telephone book, have him search for results based on lastName and/or firstName. That will cut down on the number of records returned. Next, does the user really need all the columns of data in each record? That will cut it down further.
    You can search Google for 'java heap size' to increase the memory for your program. However, your 65536 limit is probably due to Excel's limitation and not your Java program.Sorry I could not explain the need,
    No. That is not issue here. I already use max heap size I can
    but I can handle it now. Open files, write directly to the file instead of holding the data and dumping all at once. I save all the overhead and it works fine even the result set still consumes almost all the memory.is it possible you are using mysql? the mysql jdbc driver has a terrible default setup in that it keeps all results for the result set in memory ! i think some of the latest drivers finally allow you to stream results sensibly, but you have to use the correct options.

  • How do I backup a very large music library?

    I have about 3TB of music files on 2 external hard drives. A lot of this music is live recordings (obtained legally) which are not available commercially.  I feel like I am at risk with no backup solution, but I have not been able to find a suitable solution.  Any help here would be greatly appreciated.  Thanks in advance.

    This method deleted the huge "Other" file, but of course results in a long term issue of re-loading the ipod w/a large original file. On a external drive, I have my itunes music folder and other music in MP3/CD formats. I've tried to load these songs to the ipod, but it seems to want to place them in the "Other" file and not music. I have been manually loading these songs from the external drive and sliding them right into the music library on the itunes page. Is this the right to do this?

  • How do I delete a very Large "Other" File

    I erroneously loaded a ton of music files to the "Other" file on my ipod classic 80g...What is the easiest way to delete this large file from the ipod?

    This method deleted the huge "Other" file, but of course results in a long term issue of re-loading the ipod w/a large original file. On a external drive, I have my itunes music folder and other music in MP3/CD formats. I've tried to load these songs to the ipod, but it seems to want to place them in the "Other" file and not music. I have been manually loading these songs from the external drive and sliding them right into the music library on the itunes page. Is this the right to do this?

  • How can I take a very large gif and print it over many pages?

    I have a gif image that, if printed, comes out all compacted (read: much too small) on one page.  It is so small that it cannot really serve as a poster that I want to hang in my classroom.
    My desired result is to take the image and somehow split / divide it so that I can print it over multiple pages, and the image be properly sized, which I can then connect to make a poster.
    Any ideas how to get this done with Fireworks?
    Thanks all!  :-)

    Illustrator is good for this. Its Print dialog allows for page tiling with adjustable overlap and includes a thumbnail preview.
    You can print from Fireworks, but it relies on the native print options of your operating system, which may or may not allow you to print a single image across multiple pages.

  • How can I split a very large chapter into 3 smaller chapters without losing imbedded photos or formatting?

    I haven't a clue what this is supposed to contain. My problem is described above.

    click in the text where you want to split them > Menu > Insert > Section Break
    Peter

  • How to get rid of the large slideshow images in Web gallery (CS4)

    Here is the deal.
    I've created a flash web gallery/ But the new CS4 has the option for slideshow with this flash stuff. CS3 use to create thumbnail and large images folders. The new one creates 3 folders: 1. thumbnails, 2, medium images, 3 large images (for the slideshow). That's great, until I go to upload process. I have pretty limited space. So I'm ready to get rid of the slideshow option, but there's no such option in gallery creating process. The only solution I have in mind is to redirect slideshow images to the medium size folder. But thats pretty annoying process during the creation of each gallery.
    So does anyone has an idea how to skip the slideshow creation or another method to skip creating 3 folders, all with the same images?

    Extend DefaultListCellRenderer, not BasicComboboxRenderer. Here's an example that wraps the original renderer and uses it where possible (i.e. instanceof JLabel). No 'white square'.import java.awt.BorderLayout;
    import java.awt.Component;
    import java.text.DecimalFormat;
    import javax.swing.*;
    public class ComboRendererTest {
      public static void main(String[] args) throws Exception {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            new ComboRendererTest().makeUI();
      public void makeUI() {
        JComboBox comboBox = new JComboBox();
        comboBox.addItem(new Double(1));
        comboBox.addItem(new Double(2.25));
        comboBox.addItem(new Double(3.5));
        comboBox.setRenderer(new TwoDecimalRenderer(comboBox.getRenderer()));
        JFrame frame = new JFrame();
        frame.add(comboBox, BorderLayout.NORTH);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(200, 200);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
    class TwoDecimalRenderer extends DefaultListCellRenderer {
      private ListCellRenderer defaultRenderer;
      private static final DecimalFormat FORMAT = new DecimalFormat("#.00");
      public TwoDecimalRenderer(ListCellRenderer defaultRenderer) {
        this.defaultRenderer = defaultRenderer;
      @Override
      public Component getListCellRendererComponent(JList list, Object value,
              int index, boolean isSelected, boolean cellHasFocus) {
        Component c = defaultRenderer.getListCellRendererComponent(list, value,
                index, isSelected, cellHasFocus);
        if (c instanceof JLabel) {
          ((JLabel) c).setText(FORMAT.format(value));
        } else {
          c = super.getListCellRendererComponent(list, value,
                  index, isSelected, cellHasFocus);
          setText(FORMAT.format(value));
        return c;
    }db

  • How to save a file as a clickable image

    I'm new to Flash (CS5.5) but have self taught quite a bit. I created a simple "slide show" model of images which fade in and out to other images—it's a holiday greeting card. How do I save/export/publish (not sure of the correct terminology) this .fla file so that my end result is an image that I can insert (as an image) into an email (outlook) and send. The recipient should be able to click on the image and activate the movie. I've searced for hours on the web and have not found the answer.

    Sorry, but you are driving a Fiat and stopped by the Indian Motorcycle dealership to ask for help. (in other words, this forum isn't for help with Flash.)
    Click the link below and read the material at the top of the page in red. There is a link you should follow from there that will hopefully get you in the right place to find help.
    Click here to view
    Best of luck! Rick

  • Is it possible to make a very large disc image?

    This question is in relation to the first I asked. But my goal here is to use approximately 75% of my 2TB TC as external storage, and have the remaining 25% be for the continuous backups. What is the best way to go about doing this?
    Is there a way to make a disc image that is larger than 500MB? That's a really insignificant amount of space, and it would be ridiculous to make 1.5 TB worth of those.
    So if that wouldn't work, is there a way to limit the backups so that they start deleting the oldest ones when it's used up 25% of the total memory? Then I could just use the rest of the space how I wanted.
    Sorry, I have lots of questions here. My last one, is there a way to set the backups to happen say every week, rather than every hour?

    A partition can be thought of as a division or "part" of a real hard disk drive. When you partition a hard drive, you make it available to an operating system. Multiple partitions on a single hard drive appear as separate drives to the operating system.
    Disk images are a way of packaging several files together for convenience, so that they can be downloaded and copied as a single file. A disk image file can be identified by its ".dmg" extension. These files are called "disk image" files because when they are opened to access their contents, your Mac treats a disk image as if an actual physical disk had been inserted.

  • How to save files to disk without losing image quality

    Hi, I'm a Visual Basic developer and I'm doing an acquisition system with a CCD camera and 1408 IMAQ framegrabber. I need to save the images into a hard disk. My problem is that when i begin to save images to disk, the acquisition's performance come down (the images gets slow).
    Now I'm using the ActiveX CWImaq provideing by National Instruments.
    I would be grateful if you would send me any advice.
    regards.

    There is a really good tutorial on the developer zone called IMAQ Acquisition, Images, and Displaying in Visual Basic , which talks also about buffered image acquisition in Visual Basic.
    You can find built-in examples of how to do buffered image acquisition in the following folder with the default path: C:\Program Files\National Instruments\NI-IMAQ\Sample\VB\
    I hope this helps!
    Regards,
    Yusuf C.
    Applications Engineering
    National Instruments

  • Very large DVD image/folder ( dvd9 in size)

    I'm having problems making an bluray folder or image that is readable by anything!, (using encore).
    So In encore i changed the project format to DVD and set the disc size to custom = 20G !
    My mediaplayer (popcorn hour) did play it OK, incl first-play, menus and subtitles, but i wonder if anyone else have experience with generating DVD image or folder which are large than dvd9 ?
    (obviously you can not burn it, but who does that nowadays anyway)
    /per

    ..to answer my own question: the 20G 'DVD' played very well...
    now I wonder if the player wil accept H264 encoding instead of MPEG2
    ..if so, i guess the only difference to bluray would be the lack of popup menus ?

Maybe you are looking for