Answered Fill a complex external shape on a PictureBox

Leden

Member
Joined
Jul 24, 2020
Messages
9
Programming Experience
10+
Hi, I am quite new to C# and would like to re-write an app that I have developed in VBA recently.
I have several complex shapes drawn externally in PowerPoint and saved as .png and/or .bmp pictures. I have loaded one of them manually on the pictureBox1. Now I want to fill solidcolor it by a control, say a slider at a rate of app 5-10 RGB colors per second over a range (there are 250+ colors over the entire range of the vertical slider).
How can I do this? Most of the 'Fill Color' examples I've found on the web deal with drawing a rectangle/oval and then filling it. Since I already have a shape loaded on the Form how can I introduce it and then change the color? My picture consists of two parts: Outer block - a rectangle working as a background and an irregular inner shape which needs to be painted/filled. To give the Fill effect of a Paint program am I supposed to define a pixel inside the inner shape first?
Thank you..
 
Thank you! But please don't bother to help if you don't want to be a bit more explicit in your answers to a newcomer...
Relax your cacks, and don't be rude. You are getting help. It not my fault that I wasn't aware you wanted to be spoon fed.

Seems rather obvious. Your method takes a parameter and you are not providing it. What's not to understand?

Maybe you will find the documentation I linked a more helpful than the obvious point I was making.
 
I normally don't assist people who are being rude. But I'll make an exception and take on board you are probably frustrated. At the same time, its important to note that this is a help forum aimed at educating the troubleshooter. I'm trying to get you to pay some attention to your own code. Let me put it another way; do your drawing with a Graphics object and with that object, you pass it via the PaintEventArgs.
 
Part of the issue is that the OP didn't write that code for FillPathEllipse(). Notice that naming convention doesn't match the rest of his code. Looks like he just copied and pasted the sample code from the MSDN documentation for FillPath()
 
So the OP has been reading the documentation prior to my linking of those docs, yet still doesn't understand the issue despite it being documented and explained by myself. Ah well
 
Well Sheepings, first of all, I really don't understand what made you so defensive and sarcastic at the same time, all of a sudden, since my criticism was a true one and didn't have any rudeness. Surely, you cannot just say "read this, read that, the answer is blowing in your code.." as such. May I suggest you just check your advice in this thread and let me know if you happen to find anything palpable. People who register to forums also read and watch almost all the resources available on the web. However, you need a helping hand for the very first few strokes when you learn swimming, for instance. It then leads to and speeds up the self-learning process.
Anyway, I don't think I can benefit from this thread or it will change anything. Therefore I assume it is closed now and will also ask the forum management to delete my membership please.
 
Firstly we don't delete accounts as far as I'm aware.

Secondly, my response was not " triggered ". If you are unable to read the documentation provided and understand simple logic with your 10 years+ experience, then maybe C# is the wrong language for you to be using.
Thank you! But please don't bother to help if you don't want to be a bit more explicit in your answers to a newcomer...
That was rude regardless whether you want to admit it or not, and you could have politely asked for an elaborate answer to what I was hinting at. I am also not discussing how I reacted nor do i feel obligated to justify any of my replies as i see nothing wrong with them given your attitude in the quote above. I explained the issue, as Skydiver linked you the documentation for the method you blindly copied from the docs page.

Thirdly. Your reaction here is priceless. It's like walking up to a door, and expecting to enter it without the keys. If the door of your home takes a key to open the lock, would you still ask me how to open the door?

On p/#18 I told you exactly what your issue was, and how to fix it. You then come back at me spoiling for a fight above which I won't be biting for. If you don't like the advice you got, then I am sorry for you. If you don't understand something that is being clearly pointed out to you, then that's your inability to understand simple logic, and nobody can help you with that.

Lastly, demanding or wanting your account closed because you misunderstood the obvious answer being pointed out to you is rather childish and silly. I also made allowances for your frustration in a previous post, but don't be a twat and try and spin this and say that you are leaving the site because of me. If you want to stay on the Csharp forums and learn, then do that. Nobody is stopping you, but keep your fight spoiling and rude replies off the forums please.

Now lets leave it there. If you have any more questions about your source code problem, then be sure to keep your topic about the problems you are experiencing and not about the replies you got.
 
Back
Top Bottom