Results 1 to 3 of 3

Thread: Out of Memory in pictures

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    Out of Memory in pictures

    well..i am doin a button that will download a picture off the internet and in the end will show the downloaded picture in himself...but i am getting a g@y "out of memory"... grrr the code is the following:

    this is where the error is:
    PHP Code:
            private void downloadProgress(downloadManager e)
            {
                if (
    this._currentProgress == 100)
                {
                    
    string fn "C:\\pic.jpg";
                    
    _parent.Image Image.FromFile(fn);
                }
                else
                {
                    
    this._currentProgress = (int)e.currentProgress;
                }
            } 
    the code that draws the picture is this:
    PHP Code:
            private void OnPaint(object senderSystem.Windows.Forms.PaintEventArgs e)
            {
                
    Button button = ((Button)sender);

                if (
    this.devImplementation.isProgressBarVisible == true)
                {
                    if (!(
    this.devImplementation.currentProgress >= && this.devImplementation.currentProgress <= 100))
                    {
                        throw (new 
    System.ArithmeticException("The value must be between 0 and 100"));
                    }

                    
    double progress = ((double)this.devImplementation.currentProgress / (double)100) * (double)button.Width;
                        
                    
    e.Graphics.FillRectangle(
                        new 
    System.Drawing.SolidBrush(this.devImplementation.mainColor),
                        new 
    Rectangle(
                        new 
    Point(0button.Height 10),
                        new 
    Size((int)progress 20)
                        ));
                }
            } 
    \m/\m/

  2. #2

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    anyone...? i just cant find a way of doin this..i tryed in another project puting the Image.FromFIle() and it works fine but under these circunstances it seems not to be working...i also checked that the program "just" needs 15mb ram when in runtime so i really dont understand the why of "out of mem"
    \m/\m/

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hmm the pic was in use,
    problem solved
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width