|
Yes, you have a real and a shadow image; you show the real one, but virtually you walk the shadow one so you get room identification almost automatically.
To highlight a room, you could do one of several things:
- replace the entire picture by a new one which you created manually (so N rooms takes N+1 pictures plus a shadow image); conceptually simple, lots of unrewarding work.
- replace the entire picture by a new one which you calculate on the spot. It could consist of the original pixels unmodified except for the ones that are inside the room, you could change their visible color and/or brightness; for a black-and-white floor plan, you might want to highlight the "current" room using a yellowish local background. It probably takes a couple of tricks to get that to work swiftly; you can't do a full 600*800 GetPixel/SetPixel loop fast enough, but you could do a two-image flood fill (scan the shadow, modify the visible image). Alternatively, you could extract each room once, from the shadow image; so you get separate room images, which tell you where the highlight should happen. If you make all room images the same highlight color, all you need is painting two images on top of each other: the real one, and the current room.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I think the first one is the most work but would be most likely what I know to do. Because there really isn't anything specifying the size and shape of the room. There is just the color of it.
So when the mouse hovers it gets the room number from the shadow image (by the color) and replace the visible one with a new 800x600 image with just that room highlighted.
Have you ever attempted this before? I'm wondering if you would see the whole form flash or if it will actually look like the room just highlighted
|
|
|
|
|
splitting the shadow image into separate rooms is easy, as each room has its pixels in a different color.
it would be rather slow, however it needs to be done only once; so your app could do it once, at startup, in a background thread; or do it just-in-time and cache them; or you could write (the same) code to do it beforehand, and ship all the images with the app, possibly as embedded resources.
I haven't done this recently; I have done similar things in the past though. And I would see no flashing whatsoever, as I would probably use double-buffering, and the two images are very similar anyhow; where they differ, they do so on purpose. One should take care not to change anything as long as the current room does not change.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I've been working on this and everything is going really well except one thing.. some colors are coming up different from photoshop vs when deployed in the application.
One color I chose is a redish color..
In photoshop it shows:
R= 253
G= 54
B= 0
But when I display the color in my application it shows as
R= 253
G= 29
B= 0
which is giving different colors? Any idea why? I saved it as a GIF format as you suggestde
|
|
|
|
|
I don't know, and I'm not sure it is relevant. I did suggest you use your app to sample the colors, then type those values into your data initialization statements, rather than reading them from the creating app's dialogs.
You could close Photoshop, then restart it to open the same image again, and have another look. Maybe somehow the colors got changed while saving. Did you have to specify some "quality" wishes?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I didn't any quality options. I'm guessing it was just to close and it converted it to the actual RGB red color? Not sure.. I just pick a different color
Just found it odd that it did that. Thanks again!
|
|
|
|
|
You're welcome.
And yes, the color drift sounds odd.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
I want to read data from serial port in a period can I reported myself with a thread and converted into digital data for display in a label
thank you in advance
|
|
|
|
|
I can't be certain of what you are asking, but if you are looking into working with your serial port, here would be a good start
I/O Ports Uncensored Part 1[^]
"I need build Skynet. Plz send code"
|
|
|
|
|
I want to read data and convert them into value
thanks
|
|
|
|
|
Hi
I am having trouble streaming jpeg's from a server to a client using TCP. A lot of the images I recieve are corrupt and some of them are superimposed on top of each other. I have used blocking, non blocking TCP and havnt been able to fix it.
I believe that to much time is being taken up processing each frame before recieving the next frame. Therefore the TCP buffer is being overwritten with the next TCP packet.
Is this what is happening or is it somthing else? And does anyone know how to fix this problem?
Thanx
|
|
|
|
|
This is the third day in a row you present the same problem without actually offering any tangible information. You did not tell what classes you use, whether you use extra threads or asynchronous operations, you did not show any code, nothing.
I don't think there are many mind readers here, so the only possible answer is: you either have a conceptual bug, or an implementation bug in your code, or a general PC problem, or very bad luck, or something else.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Ok the reason I havnt provided more info is becuase I have used mutliple methods to try and solve the same problem and none have worked. Blocked socket, non blocking socket, tcpclient ect and all have failed. Therefore the problem is not with classes or extra threads.
I have found out that I am having this problem because I am expecting to recieved the whole message in one read rather than multiple reads.
I need to learn how to frame the data. A beginners mistake
|
|
|
|
|
ikon666 wrote: A beginners mistake
The main mistake is not to provide any information on a single attempt; that way nobody can help you out.
Had you shown code, you would most likely have gotten the right answer pretty soon.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Hi everyone,
I'm developing an application that needs a new bluetooth profile, so I have to modify the Bluetooth stack to fit my requeriments. The stack should be something like this http://www.musenka.com/info/doc/MDP(MedicalDevicesProfile).pdf[^]. But I really don't know how to begin. I don't know if there is an open implementation of the BT stack that I can modify... Or if there is a way to use other stacks parts... I'm writing this in C# forum because my app is in C# but I suppose the stack changes and everything will be in C++.
Any help would be appreciate
Thanks in advance
Kind regards
|
|
|
|
|
Hi every1,
I am working with lists and faced with a problem.
this is the method in my first class which has implemented in DAL
namespace Assignmnet2
{
[Serializable]
class Student_Manipulation
{
public void ReadStudentFile(string Fr_Name, string Sr_Name, string St_Id, int Lb_Mark, int Ass1, int Ass2, int
Fnl)
{
FileStream flstream = new FileStream("c:\\student.dat",FileMode.Open,FileAccess.Read);
BinaryFormatter BnFrmt = new BinaryFormatter();
List<ITECH3219Student> list = (List<ITECH3219Student>)BnFrmt.Deserialize(flstream);
foreach (ITECH3219Student ITECH3219Student in list)
{
Fr_Name = ITECH3219Student.Fr_name;
Sr_Name = ITECH3219Student.Sr_Name;
St_Id = ITECH3219Student.St_Id;
Lb_Mark = ITECH3219Student.Lb_Mark;
Ass1 = ITECH3219Student.Ass1;
Ass2 = ITECH3219Student.Ass2;
Fnl = ITECH3219Student.Fnl;
}
}
}
-------------------
In BLL I have this class
namespace Assignmnet2.BLL
{
class Finalization
{
public void read(string Fr_Name, string Sr_Name, string St_Id, int Lb_Mark, int Ass1, int Ass2, int Fnl)
{
Assignmnet2.Student_Manipulation read = new Assignmnet2.Student_Manipulation();
read.ReadStudentFile(Fr_Name, Sr_Name, St_Id, Lb_Mark, Ass1, Ass2, Fnl);
}
}
}
----------------------
Now, in peresentation layer I have this code
private void Form1_Shown(object sender, EventArgs e)
{
Assignmnet2.BLL.Finalization ReadStudent = new Assignmnet2.BLL.Finalization();
LstBox.Items.Add(ReadStudent(ITECH3219Student.Fr_name + " " + ITECH3219Student.Sr_Name + " " +
ITECH3219Student.St_Id));
----------------
Frankly, I don't really know what I supposed to write in this layer in order to show file's information in listbox.
Could you please help me?thanx
modified on Wednesday, May 26, 2010 8:52 AM
|
|
|
|
|
Please edit your question to put your code between <pre>... your code here ....</pre> tags.
I for one will not even attempt to read such unformatted code. It hurts my eyes!!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
|
That is still not readable.
Firstly, do it by editing your original question, not by answering this.
Secondly, put the <pre> tag before your code and the </pre> tag after your code. Then format the code, indents etc..
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Guys, Could you please help me how Can I sort out my prob.thx
|
|
|
|
|
OK. That is much better.
In your ReadStudentFile(string Fr_Name, string Sr_Name, string St_Id, int Lb_Mark, int Ass1, int Ass2, int Fnl) , what are the parameters (Fr_Name, Sr_Name etc.) supposed to be for? You are not using them to pass data in and they are not configured to return data and even if they were they would only return the last student in the list.
Unless I have totally misread your code ReadStudentFile would be better as something like:
public List<ITECH3219Student> ReadStudentFile(string Fr_Name, string Sr_Name, string St_Id, int Lb_Mark, int Ass1, int Ass2, int Fnl)
{
FileStream flstream = new FileStream("c:\\student.dat",FileMode.Open,FileAccess.Read);
BinaryFormatter BnFrmt = new BinaryFormatter();
List<ITECH3219Student> list = (List<ITECH3219Student>)BnFrmt.Deserialize(flstream);
return list;
}
Your Assignment2.BLL would also need to be rewritten to return the List<ITECH3219Student> , once again no obvious need for the parameters.
and then in your Form1_Shown something like
private void Form1_Shown(object sender, EventArgs e)
{
Assignmnet2.BLL.Finalization ReadStudent = new Assignmnet2.BLL.Finalization();
List<ITECH3219Student> studentList = ReadStudent.read();
foreach (ITECH3219Student student in studentList)
{
LstBox.Items.Add(student.Fr_name + " " + student.Sr_Name + " " + student.St_Id));
}
}
This should work, although I have to say that the slightly 'artificial' way that you have divided the functionality between the various classes indicates that you have not really understood the assignment.
Good luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Ummmm....homework?!?!?! Why did you provide an answer to this that included an implementation? Did you not notice that his namespace is "Assignment2" ?
"I need build Skynet. Plz send code"
|
|
|
|
|
What can I say? I'm in a good mood today.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Hi,
I really appreciate for your reply.I realized my problem in first part, as you said.
still I am confusing regarding this line
Your Assignment2.BLL would also need to be rewritten to return the List, once again no obvious need for the parameters.
Could you please explain a little more. why I don't need parameter?
Thanks in advance.
|
|
|
|
|
You don't need the parameters because you aren't using them.
As I said in my previous reply, you are not passing any data in them and they are not configured to return any data.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|