Bitmap loading generates InvalidCastException

Hello all,
i'm on compact framework 2 (CLR Version: 2.0.7045.0), and i keep getting these first chance exceptions (disabled breaking on them) in my code when trying to load a bitmap from a file. However, the bitmap is created correctly.
I've seen it happen with both jpg and png, others i haven't tried yet.
Bitmap tmp;
tmp = new Bitmap(BackgroundImage);
or silimar ones all generate this.
A first chance exception of type 'System.InvalidCastException' occurred in System.Drawing.dll
The error is happening here:
System.Drawing.dll!Microsoft.AGL.Common.MISC.CreateMemoryStream(System.IO.Stream stream = {System.IO.FileStream}) + 0xb bytes   
and detailed one is:
System.InvalidCastException occurred
  Message="InvalidCastException"
  StackTrace:
    at Microsoft.AGL.Common.MISC.CreateMemoryStream()
    at System.Drawing.Bitmap..ctor()
    at OctopusCF.UI.xml.SkinConfig.GetBackgroundImage()
    at Octopuscf.Program.Main()
Anyone have any idea where they come from? As the bitmap gets created correctly, could it be that something is happening internally in the system.drawing dll, from which it can recover and still load the bitmap?
Thanks,
Kristof

Yes. You should cache bitmaps you're going to reuse not just because of exception but mostly because it takes a long time to decompress bitmaps. Exception take may be 1-2% of that time. Watch out for available memory though, don’t cache too much.

Similar Messages

  • Problem with public folder initialization on exchange load generator 2010

    hi,
    we need to make some stress charge for a migration between 2010 and 2013. Before that we need to populate our exchange 2010 lab with full mailbox and public folders. So we tried Exchange load generator 2010 for this task ( initialization only). 
    Loadgen did well for the mailbox but we have some problems with the public folders. we have an empty public folder database and the user we run loadgen with has organization admin and public folder management right. the problem is that when we run this command
    (for initializing public folder only, mailbox's done) :  
    loadgencmd.exe /p /c config.xml /add trace.log 
    IT create only one public folder with the user we run loadgen with, and 5-8 objects inside. We need that It create a public folder for each users it created before. Maybe we do not understand loadgen
    correctly...

    I found my solution :
    customize the <PublicStoreProfile> section in the configuration file as follows:
     <PublicStoreProfile>
        <MessageFiles />
        <TopLevelFolderCount>1</TopLevelFolderCount>
        <NonTopLevelFolderCount>1</NonTopLevelFolderCount>
        <MinimumFolderDepth>1</MinimumFolderDepth>
        <AverageFolderDepth>2</AverageFolderDepth>
        <MaximumFolderDepth>3</MaximumFolderDepth>
        <MinimumMessageCount>5</MinimumMessageCount>
        <AverageMessageCount>10</AverageMessageCount>
        <MaximumMessageCount>15</MaximumMessageCount>
        <UseOrdinalFolderName>false</UseOrdinalFolderName>
      </PublicStoreProfile>
    Simply put differents values for each variables.

  • AJAX True Client issue with Load generator and BPM

    Hi every one,
    when i try to run Ajax True Client scrit from controller with Load Generator other than local machine,
    it is failing with an error "cannot find usr file". 
    Root Cause:
    this is because it is missing "webiendp.txt" file while copying the script to Load Generator machine. by placing this file manually in that location, its working fine.
    But in case of BPM we cannot do like that. BPM always make a copy of the script and after execution it clean up the entire folder.
    is there any settings to copy the entire folder to BPM/LG location, with out missing "webiendp.txt"?
    thanks in advance.

    This question seems like it's better suited to the [url http://forums.oracle.com/forums/forum.jspa?forumID=561]JRockit forum
    John

  • Distribution model of cep load generator

    Hi guys,
    Do you happen to know the distribution model (eg. Poisson ,uniform...) of Oracle CEP load generator?
    Cheers,
    Alireza

    Seems there is no documentation for this.
    My curve fitting experiment shows it does not follow a particular distribution. For example for rate 100 tuple per second the distribution model is t location-scale for some queries, whereas for rate 50k and 100k the distribution is more fit to Weibull and generalized extreme value distribution.
    I just wanted to insert some pics here but the system gives me error. Anyway, this is the answer.

  • MAXDB and benchmark factory(or any load generator)

    hi
    Has anyone tried running Benchmark Factory with MAXDB successfully ?
    (This is the version i am running maxdb-all-linux-64bit-x86_64-7_6_06_10 to test our new platform)
    If not, what load generator is recommended for use with MAXDB ?
    thanks
    A.

    Hi,
    I have not tested yet, but you can take a look at [url http://www.dominicgiles.com/swingbench.php]Swingbench that is a free load generator (and benchmarks) designed to stress test an Oracle database (9i,10g,11g). In addition, you can also take a look at [url  http://www.oracle.com/technology/obe/obe9ir2/obe-mng/wkldgen/wkldgen.htm]Workload Generator but it seems it was designed to work on Oracle 9i.
    Cheers
    Legatti

  • HP Load Runner: CPU usage for this load generator has exceeded 80%

    Recently I have downloaded LR 12.1 and installed.   Observed error  CPU usage for this load generator has exceeded 80% when executing the test with 5 user load using AJAX Trulcient IE script. For each virtual user in the script one TcWebIELauncher.exe hads been initiated and running during the test execution. Each TcWebIELauncher.exe instance is taking min 14% CPU utilization and CPU utilization for 5 users is around 75% at the time of test execution.  What is the reason behind this high CPU utilization for this less user load?. Please suggest how to handle and fix the issue.
    regards,
    Sreekanth

    You can download Trail version of Loadrunner from HP site.  That's true. all HP testing tools products are license based.
    i) If you want to use for SAP applications, you need to have SAP protocals (SAP GUI and SAP WEB). So how this licenses works is, if you want to buy 50 Vusers for SAP it cost you around $ 32k and it depends on company discount. so you need to work with HP Sales team to get the quotation then based on no of Vusers and you can procure it.
    ii) As for as i know, there is no  HP LR integration with Solution Manager.
    let me know if you have any questions.

  • Download load generator

    Hi
    I've downloaded HP LoadRunner 12.0 and was trying to evaluate it.  I've downloaded both HP_LoadRunner_12_Community_Edition_T7177-15045.exe and HP_LoadRunner_12_Community_Edition_Additional_Components_T7177-15046.  But, I was unable to find a loadgenerator installer anywhere.  Can someone help me in getting load generator software please ?
    Thanks
    Siva

    please refer to http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/loadgen.htm#i1014416.
    test.senders is used for this

  • Exchange Load Generator 2013 "well known" profiles

    We are about to start testing Exchange 2013 implementation in new centralised configuration.  We have figures for current user behaviour and need to ensure system can support expected workload.
    Cannot find accurate documentation that describes what's in the 'well-known' profiles for Exchange load generator 2013.  In previous versions, there were 'light', 'medium', 'heavy' and 'extraheavy' profiles that were totally defined within Loadgen. 
    The only references I can find are in the Exchange Load Generator word document that encourages the use of these without defining any of them. 
    The only sample I can find is in the profiles directory where there is how-to.txt that has an example of a customized MailboxStoreProfile with WellKnownProfileType "150M".

    Like I said in my response to your other post in this thread, I wouldn't try to be too clever with this tool.  Tune the parameters to get the number of IOPS you want in your disk subsystem, and then measure the performance.  If you can get the
    required I/O performance, i.e., 10ms maximum average log write latency and 20ms maximum average database read latency with peaks not exceeding 100ms, while sustaining the required number of IOPS, your storage subsystem is good.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Exchange Load Generator 2013 ActiveSync usage

    Exchange Load generator 2013 is announced as supporting ActiveSync.  In the modules directory there is a Microsoft.Exchange.Swordfish.Extensions.ActiveSync dll.
    I'm looking to find any documentation about how to set this.  I am about to conduct a test with a large rate of ActiveSync and need to know how I can specify this.  There's nothing I can find in the supplied word document.

    Just between you and me, I wouldn't get that clever with LoadGen.  It's a great tool for generating transactions primarily for testing disk subsystems, but it's really time consuming to get it configured for testing the various protocols.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Cache/copy Bitmaps loaded from external source?

    I'm working on a chat application that retreives user profile icons from remote sources (e.g. Blogger, Yahoo, Gravatar, etc). Easy to get the images in a Loader and display them.
    The problem is that a single thread could have hundreds of records, but probably only 10-20 active commenters. In a standard browser, each <img...> link after the first one is cached, so you only hit the source site once. Is there any way to cache/store/copy those images within Flash to avoid requesting the same image over and over?
    I can do it in the Local sandbox by accessing the BitmapData of the loader content and cloning a new bitmap for subsequent instances of the same request URL, but of course once the application moves to the Internet the security system requires a Policy file allowing bitmap access. I doubt that I can get Yahoo to add one for me. I don't need to manipulate the bitmap at all, just copy it. Or reference it as content from multiple Sprites, or something along that line. Once I've downloaded the image once, I don't see why the security system would prevent me from displaying it unchanged as many times on the page as needed.
    If this can't be done in AS3, perhaps it would be a good feature to add in the next release? Remote image caching is pretty well accepted in other platforms.

    I put  trace on the image URLs, and they always showed HTTP Status = 200 - they were loading every time. In any case, I came up with an easy workaround. I out a php script on my hosting server that fetches the image, then use that as the URL for the loader object. Voila, no security violation because the php is in the same domain as the swf. Cut down load time by at least a factor of 5.
    Only problem is, the loader always gets a 200 status on the php script, eve though I'm setting an Http header to send a 404 (the same URL from a browser gets the 404 response.) That generates an Unkown File Type error in my SWF so I have to trap that rather than the http status. It works, except I can't differentiate b/t a non-existant image and a server or connecion error. Or at least, I can't do it without a lot more code

  • Problem loading generated (X)HTML in Internet Explorer dialog window

    Hi,
    Using JDeveloper 11.1.1.4.0.
    In our ADF application we are providing a preview functionality to letters that the users can generate. The preview XHTML code is generated by stored procedures and displayed in a dialog window as an iframe. This works fine in Firefox but in Internet Explorer there is only a spinning blue circle where the iframe is supposed to be and the preview is not loading. If I copy-paste the preview URL to a separate IE window it loads up correctly, so there is something wrong in the way the dialog window tries to display the data.
    This is the preview JSPX page:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <!-- jsp:directive.page contentType="text/html;charset=UTF-8"/ -->
      <f:view afterPhase="#{backingBeanScope.RenderBean.checkPhase}">
        <af:document id="d1" rendered="false">
          <af:messages id="m1"/>
        </af:document>
      </f:view>
    </jsp:root>The preview page is embedded as an iframe on the dialog window:
    <f:facet name="center">
                <af:inlineFrame id="if1"
                                source="/faces/ActualTemplatePreview?messageTemplateId=#{pageFlowScope.MessageTemplateId}&amp;isOpenTemplate=#{pageFlowScope.IsOpenTemplate}&amp;messageText=#{pageFlowScope.MessageText}"
                                styleClass="AFStretchWidth"/>
              </f:facet>And this is the backing bean:
    public class RenderBean{
        public RenderBean() {
            super();
        private BindingContainer _b(){
          return BindingContext.getCurrent().getCurrentBindingsEntry();
        public void checkPhase(PhaseEvent event){
            if(PhaseId.RENDER_RESPONSE == event.getPhaseId()){
              final ResponseWriter writer = FacesContext.getCurrentInstance().getResponseWriter();
              try{
                final Object xhtml = _b().getOperationBinding("GetXhtml").execute();
                writer.append(xhtml.toString());
              }catch(IOException e){
                throw new RuntimeException(e);
    }GetXhtml method is defined in the application module and calls the stored procedure which generates the code.
    Any ideas what might be the problem? I read some older threads about Internet Explorer having problems with MIME types when displaying PDF inline (see e.g. {thread:id=2361293}), could this somehow relate to displaying (X)HTML code too?
    Regards,
    Joonas

    Could be something with an IE conditional statement in the code used to place the Flash on the Web Page. Post a link to the page and let us take a look.
    Best wishes,
    Adninjastrator

  • Swingbench Load Generator fails to quit the users

    Hello All,
    We have an Oracle DB 10.2 running on HP-UX. This is a demo application to demonstrate the migration of the CPU on the vPar environment when the oracle load goes high. We are using swingbench to generate the load to the Oracle DB.
    The problem here is, the swingbench is configured with 7 users to generate the load to the Database. The load is not stable on the swingbench. It started with full load and it goes down to half. While analyzing the issue, we found that the "PL/SQL lock timer" is created on the db and fails to clear that lock. Basically it should fluctuates and it should goes to 0 sometimes. But in this case, it keeps on 7 locks. Due to this, the swingbench fails to logs off the users after the load generation completes.
    Is this the problem with the db or related with the swingbench.
    Please Advise.
    Thanks,
    Jayaprakash S

    To Say in clear Words, We have a Oracle 10i Database and are using swingbench to increase the load in Oracle for an demonstration. But the swingbench is not maintaining the load on the oracle till the end of the scenario (10 mins).
    The same setup is working for another instance of Oracle.

  • Bitmap indexes generated by procedure dbms_odn.createdimmv_gs

    I run the procedure dbms_odn.createdimmv_gs for the dimension products_dim of schema sh, and I have the creation of the following index:
    CREATE BITMAP INDEX MV_PRODU_PROD__OLAP_PREL_FI ON PRODU_PROD__OLAP
    ( (CASE SYS_OP_PARGID(GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID)
    WHEN(7)
    THEN TO_CHAR(SYS_OP_PAR(0, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    WHEN(3)
    THEN TO_CHAR(SYS_OP_PAR(1, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    WHEN(1)
    THEN TO_CHAR(SYS_OP_PAR(2, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    ELSE TO_CHAR(SYS_OP_PAR(3, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID)) END) )
    TABLESPACE AGGR_IDX
    PCTFREE 0
    COMPUTE STATISTICS
    LOCAL
    NOLOGGING;
    I would like to know if somebody know the function SYS_OP_PAR that is used inside this function based index. I make a research on Metalink but I haven't found anything.
    Thanks.
    Claude-Alain

    I run the procedure dbms_odn.createdimmv_gs for the dimension products_dim of schema sh, and I have the creation of the following index:
    CREATE BITMAP INDEX MV_PRODU_PROD__OLAP_PREL_FI ON PRODU_PROD__OLAP
    ( (CASE SYS_OP_PARGID(GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID)
    WHEN(7)
    THEN TO_CHAR(SYS_OP_PAR(0, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    WHEN(3)
    THEN TO_CHAR(SYS_OP_PAR(1, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    WHEN(1)
    THEN TO_CHAR(SYS_OP_PAR(2, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID))
    ELSE TO_CHAR(SYS_OP_PAR(3, GID, PROD_TOTAL, PROD_CATEGORY, PROD_SUBCATEGORY, PROD_ID)) END) )
    TABLESPACE AGGR_IDX
    PCTFREE 0
    COMPUTE STATISTICS
    LOCAL
    NOLOGGING;
    I would like to know if somebody know the function SYS_OP_PAR that is used inside this function based index. I make a research on Metalink but I haven't found anything.
    Thanks.
    Claude-Alain

  • CMT processor load generator

    Is there a tool that can load a CMT processor to the desired level?
    For example, I have a 8-core CMT processor on which Solaris OS is running and I want to load 4 out of the 8 cores to 50%. (Using corestat utility, I should be able to see 4 out of the 8 cores are loaded to 50%)

    I use The Grinder. grinder.sourceforge.net
    You can develop your own test and control it the way you want.
    Hope it helps!
    Chris.

  • SAP load generator SGEN

    Hi experts,
    We have a new SAP ECC 6.0 installation; MSSQL, Windows. When transaction SGEN is executed and started; progress shows  0% complete after 24 hours, which does not appear normal to me. And job status stays active.
    What could be the problem here? Any ideas?
    Regards,
    AK

    Hi ,
    First refreshing the Screen first  of  SGEN ... Check wheather your Background WP's are free for the process.
    Check the Log of active Load job this might give you any Click.
    At last Check your $tmp tablespace wheather it has space or not ...
    If these checks cant find anything wrong in your system then i will suggest try cancle the current job and start again.
    You can also check for loading the perticlar s/w component (Only One ) first and see the result ...
    Hope this helps..

Maybe you are looking for

  • How can I get  the MDX-statement which is generated in a query?

    Can I somehow get the MDX statement, which is generated when I create a Query via BeX Query Designer? I am using JCo to connect to BW (3.0b) and to execute MDX statements from a standalone JAVA-application. It would be very helpful to have the statem

  • Help! Why can't I send to a group? Please help!

    When I try to send an email to a group, with the individual addresses hidden (set in preferences), I get the following error message: *This message could not be delivered and will remain in your Outbox until it can be delivered.* *Sending the message

  • PI 71. System copy

    I am copying my PI Production system back to my Integration test system. I have read the System copy guide(s) and concermed that I may select wrong method. I am going to copy ABAP via  DB Oracle tools. But the java side we are not sure how to proceed

  • SAP Workbench Issue Business Partner Master Data

    Hi Team, I have an issue which we could not update existing Business Partner Master Data but we can add new. The data involved are marked in red below. Please advise. Thanks. Regards, David Lai

  • Nokias amazingly tolerant customers

    I think Nokia are incredibly lucky to have such loyal, tolerant and forgiving customers. After years of bug ridden, unreliable and often poorly functioning Nokia phones I have given up and switched to Sony Ericson's. I appreciate that Sony do not see