Jump to content

Gradient Control w/ Top + Bottom Colors?


APShredder

Recommended Posts

Ok, well I almost got copying the code to work, except I'm still getting a error message. I've tried everything I can think of (which isn't all that much) to get rid of it, but it won't go away. :?

Error Message: 'ExtractColor.GradientControl.Dispose(bool)': no suitable method found to override

And of course here's the code that's causing the error.

namespace ExtractColor
{
   partial class GradientControl
   {
       /// 
       /// Required designer variable.
       /// 
       private System.ComponentModel.IContainer components = null;

       /// 
       /// Clean up any resources being used.
       /// 
       /// true if managed resources should be disposed; otherwise, false.
       protected override void Dispose(bool disposing)
       {
           if (disposing && (components != null))
           {
               components.Dispose();
           }
           base.Dispose(disposing);
       }

       #region Component Designer generated code

       /// 
       /// Required method for Designer support - do not modify 
       /// the contents of this method with the code editor.
       /// 
       private void InitializeComponent()
       {
           components = new System.ComponentModel.Container();
           this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       }

       #endregion
   }
}

Link to comment
Share on other sites

Ok well I tried doing that, but all I got was a new error message.

'ExtractColor.GradientControl' does not implement interface member 'System.IDisposable.Dispose()'

I get that along with the other message I was getting before.

using System;

namespace ExtractColor
{
   partial class GradientControl : [b]IDisposable[/b]
   {
       /// 
       /// Required designer variable.
       /// 
       private System.ComponentModel.IContainer components = null;

       /// 
       /// Clean up any resources being used.
       /// 
       /// true if managed resources should be disposed; otherwise, false.
       protected override void Dispose(bool disposing)
       {
           if (disposing && (components != null))
           {
               components.Dispose();
           }
           base.Dispose(disposing);
       }

       #region Component Designer generated code

       /// 
       /// Required method for Designer support - do not modify 
       /// the contents of this method with the code editor.
       /// 
       private void InitializeComponent()
       {
           components = new System.ComponentModel.Container();
           this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
       }

       #endregion
   }
}

Link to comment
Share on other sites

Try replacing the dispose method with:

/// 
           /// Clean up any resources being used.
           /// 
           /// true if managed resources should be disposed; otherwise, false.
           protected virtual void Dispose(bool disposing)
           {
               if (disposing && (components != null))
               {
                   components.Dispose();
               }
               this.Dispose(disposing);
           }

           public void Dispose()
           {
               Dispose(true);
           }

KaHuc.png
Link to comment
Share on other sites

Just to be clear, replace the current code with:

    using System;

   namespace ExtractColor
   {
       partial class GradientControl : [b]IDisposable[/b]
       {
           /// 
           /// Required designer variable.
           /// 
           private System.ComponentModel.IContainer components = null;

               /// 
               /// Clean up any resources being used.
               /// 
               /// true if managed resources should be disposed; otherwise, false.
               protected virtual void Dispose(bool disposing)
               {
                   if (disposing && (components != null))
                   {
                       components.Dispose();
                   }
                   this.Dispose(disposing);
               }

               public void Dispose()
               {
                   Dispose(true);
               }

           #region Component Designer generated code

           /// 
           /// Required method for Designer support - do not modify
           /// the contents of this method with the code editor.
           /// 
           private void InitializeComponent()
           {
               components = new System.ComponentModel.Container();
               this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
           }

           #endregion
       }
   }

KaHuc.png
Link to comment
Share on other sites

'ExtractColor.GradientControl' does not contain a definition for 'AutoScaleMode' and no extension method 'AutoScaleMode' accepting a first argument of type 'ExtractColor.GradientControl' could be found (are you missing a using directive or an assembly reference?)

The name 'PixelOffsetMode' does not exist in the current context

The type or namespace name 'InvalidEnumArgumentException' could not be found (are you missing a using directive or an assembly reference?)

There's a bunch of those.

The type or namespace name 'LinearGradientBrush' could not be found (are you missing a using directive or an assembly reference?)

The name 'SmoothingMode' does not exist in the current context

Cannot implicitly convert type 'PaintDotNet.ColorGradientControl' to 'ColorGradientControl'

There's a bunch of those too.

These are pretty much all the errors and there are some warning messages too, which I can post if you want to see them.

Link to comment
Share on other sites

I think you need to learn more of the basics of C# and programming in general... Simon is not your personal tutor/debugger.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

As much as I hate to admit it, you're probably right. I've been trying to figure out something more then just the basics, but I can't find anything that really helps me. I've tried reading source codes from different plugins, I've tried finding online tutorials, but nothing every really helps. So, maybe it's better if I step away from programming for right now. Or on second thought maybe you could tell me somewhere where I can learning more than the basics. I'd really appreciate it.

Link to comment
Share on other sites

No no no, I don't mean to discourage you from programming. I'm just trying to say, start with a foundation instead of trying to start with the electricity and plumbing. Have you looked at BoltBait's CodeLab tutorials? Google is also a very good resource for either tutorials or looking up any error messages you get.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Yeah, I get what you're saying. After reading your post, I decided I was high time I actually learn programming from someone other than myself. You see, everything I know so far, I taught myself. I never had any kind of tutoring from anyone other than a few online tuts. So I googled a few C# websites, and I'm starting my programming education over. So I have to say thank you pyrochild, for helping me realize that I needed to learn the basics before I could do anything too advanced.

Link to comment
Share on other sites

I better see some awesome plugins coming from you soon :P

Also, don't be afraid to ask for help on this forum -- that's what it's for, after all. Just try not to turn it into "write my plugin for me." ;)

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

I better see some awesome plugins coming from you soon :P

Don't worry I plan to. :wink:

Also, don't be afraid to ask for help on this forum -- that's what it's for, after all. Just try not to turn it into "write my plugin for me." ;)
Don't worry about that either. I'll probably still have a bunch of questions along the way though.
don't get discouraged. I've been reading and re reading C+ book for over a year. just starting to get the idea of what's what. I haven't even tried to do a plugin yet. you are way ahead of me.

keep at it. go slow, try not to get discouraged.

ciao OMA

Thanks for the wise words of encouragement oma. :)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...