|
Hello All,
My windows form application which allows users to import, edit, and save images works for the most part. However, it lacks many features that I would like to have but I have no idea on how to go about creating them. On top of the list of features I'd like to have is the ability to create images on separate layers. Right now I can put paint on top of an image or lay one image on top of another image but once I do that I can not separate them since they are on the same layer. Any suggestion will be greatly appreciated thanks in advance.
|
|
|
|
|
You would need to store each layer as a separate entity. When your persisted "image file" is read by your app, it should render the layers in order. In practice, every layer object will have its own properties (e.g. opacity, visibility, etc.)
/ravi
|
|
|
|
|
You should move to WPF. WPF already implements all this for you.
|
|
|
|
|
How can C # Assistance WindowsFormsApplication1 save a text document in pdf-for example, in
The second question
Notify me when someone who has a calendar to "pay something" for example ...
I can not understand how the code should be written
|
|
|
|
|
ghost22th wrote: save a text document in pdf-for example Try iTextSharp[^].
ghost22th wrote: Notify me when someone who has a calendar to "pay something" for example Check the date and compare it with the due date in your calendar/database.
Use the best guess
|
|
|
|
|
Dear
am using gmail smtp means mail send ..working good but i have change smtp name username password nic.in means did not send mail
|
|
|
|
|
|
|
You've replied to the wrong person. You should have posted this for the OP. He doesn't get notified if you reply to anything other than his post.
|
|
|
|
|
|
|
|
|
Good for you!
Now, if you have a question, perhaps you might want to tell us what it is?
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
JAYRAJ GIRI wrote: I have Use Entity Frame work in my web application
Splendid. I had porridge for breakfast. It was lovely.
|
|
|
|
|
Pete O'Hanlon wrote: I had porridge for breakfast. It was lovely.
Oooh, as did I. I mixed in a bit of maple syrup and with a bit of brown sugar and sprinkled some slivered almonds on top. Fantastic stuff!
|
|
|
|
|
Maple syrup and brown suger. Mmmmmm. Lovely.
Of course, as I'm trying to lose wait, I merely added raisins.
|
|
|
|
|
Pete O'Hanlon wrote: I'm trying to lose wait
That sounds impatient. Or did you mean "weight"?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
A bit of both. I'm impatient about losing weight.
|
|
|
|
|
Yeah, so am I, but, you have to "cheat" every now and then!
|
|
|
|
|
but, but, but..., the labels on the brown sugar and maple syrup each said that they had 0 g Fat per serving, so they can't make you gain weight, right?
It least that is what all those zero fat diet food ads imply.
|
|
|
|
|
I prefer oatmeal or oatbran with some candied pecans and fresh blueberries. I have eaten that every morning for the last several months.
|
|
|
|
|
And??
Oh well....thanks for telling us.....I guess.
When you learn to talk to humans, be sure to let us know!
|
|
|
|
|
Ok, here is my problem:- I have a tcp connection to an instrument; it is the slave and I am it's master (it speaks only when spoken to). Below is an example of how this conversation might look:-
Array.Clear(this.RXstring, 0, this.RXstring.Length);
sendMessage(buildMessage(Operation.Query));
System.Threading.Thread.Sleep(2000);
try
{
int len = this.tcp_com.Receive(this.RXstring);
string temp = ASCIIEncoding.ASCII.GetString(this.RXstring, 0, len);
if(temp.Contains("DYNAMIC")
{
this.dynamic = true;
}
else
{
this.dynamic = false;
}
}
Problem is this:- Sometimes, the data can be truncated or for some reason, maybe too big for the buffer and so a bit gets left behind. If I try and read without there being any data, it becomes stuck so I have made my buffer 1024 bytes long and added some time to try and make sure it's all arrived.
I would like to be able to clear the port somehow so that I know that there is only valid data when I get a responce and not something left over from last rx. Alternativey, I would like to be able to ask if there is data there without it crashing; I could then retrieve and discard myself.
I know that there are other ways I could have implemented the tcp bit but this seemed the simplest at the time.
As usual, all thoughts and advise gratefully received...
|
|
|
|
|
This is probably not how I would do it, but if things are as simple as you describe and you don't think it will change in the future, you should be able to make it work.
Your code is basically very similar to the sample code in this MSDN article: http://msdn.microsoft.com/en-us/library/system.net.sockets.socket(v=vs.100).aspx[^].
Notice in SocketSendReceive() how they do the Receive() in a while loop, adding to the final string each time through the loop (if you follow that sample, you might want to use a StringBuilder object instead of just adding onto the string).
I suspect your truncated and left over data issues are due to the fact that you just try to read the data into your fixed size buffer in a single Receive() call. If you don't want to use a while loop in the reading part, you could use the socket objects Available property[^] to see how much data has been received and set the size of your buffer accordingly. It is not something I will recommend because you might have to change the sockets ReceiveBufferSize to be able to receive the largest data block the device can send to you - that can end up being a frustrating back and forth exercise.
Soren Madsen
"When you don't know what you're doing it's best to do it quickly" - Jase #DuckDynasty
|
|
|
|