|
You can get what is called a 'keyboard wedge' which is put in series with the keyboard.
This has the advantage you can enter values with the keyboard when testing.
|
|
|
|
|
Hello Experts!!
I got above error when displaying image in crystal report.....
I am assigning root as Blobfield object and assigning to database field.but it gives error.
My code is:
while (dr.Read())
{
CrystalDecisions.CrystalReports.Engine.BlobFieldObject root;
root = (CrystalDecisions.CrystalReports.Engine.BlobFieldObject)objRpt.ReportDefinition.ReportObjects["Picture2"];
object s = dr["Picture"];
Byte s2 = Convert.ToByte(s);
root=(Byte)s2;
}
i dont knw how to bind dr with object.Suggest me method.......
|
|
|
|
|
Are you using a dataset? If you are using a dataset specify the datatype of the picture column to System.Byte[]. Then from the database set the value to that column as below :
DataColumn mycolumn = new DataColumn ("Picture");
mycolumn.DataType = typeof(System.Byte[]);
mysdset.Tables[0].Columns.Add(mycolumn);
mysdset.Tables[0].Rows[0]["Picture"] = GetImageData(Server.MapPath("~/ABC.Jpg"));
byte[] GetImageData(string fileName )
{
//Method to load an image from disk and return it as a bytestream
System.IO.FileStream fs = new System.IO.FileStream(fileName,System.IO.FileMode.Open, System.IO.FileAccess.Read);
System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
return (br.ReadBytes(Convert.ToInt32(br.BaseStream.Length)));
}
Hope this helps you
|
|
|
|
|
Thanx for healthy reply....i used your code but it gives error at following point as " Cannot find table 0"
mysdset.Tables[0].Columns.Add(mycolumn);
|
|
|
|
|
I'm trying to understand security in .NET.
FYI what I try to achieve is, I have the following files: MyApp.exe, MyLib.dll, Plugin.dll
I want to run everything in a low trust environment, so that only trusted source can execute. However I'd like to trust my MyLib.dll though.
As an exercise I have 2 app. App2 just start an AppDomain with lower permission set and execute App1 in it.
In App1, for the sake of the exercise, I am calling SomePermission.Assert().
This fail with a security exception. Fine, I like that. Now I strongly signed my assembly App1 and it still fails on the Assert() call with SecuritException.
mmh... how do I circumvent that?
I know that some DLL are able to do thing that the caller is not allowed to do, how do they escalate their right? why the caller cannot?
A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station....
_________________________________________________________
My programs never have bugs, they just develop random features.
|
|
|
|
|
Good day
I'm writing my first video recogntion program (for sign language specifically) from scratch (no API's). Will the performance be good enough in C# or should I consider doing it in C++?
I'm hoping to aim for 10 frames per sec
|
|
|
|
|
Well, any day C++(unmanaged) would give better performance than C#. But both have pros and cons, C# is no doubt is eay to develop and maintain.
Again, it depends how much throughput you want from your app. I don't think 10 frms/Sec would be a problem.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Well naturally your hardware will come into play. But another big part of the performance depend on how well your processing algorithms are optimised. C++ will offer a better performance than C# with the same algorithms but the problem there is that C++ requires a lot more effort and this may result in poor coding and thus slow the algorithms down, but if you do your research and make sure you get it right then go for C++.
It may only be 10 FPS but your going to have to use some pretty meaty algorithms to achieve what your trying to do, in this case I think performance needs to be a major focus.
Thou if I was you I would forget performance for now and use C# to first get my algorithms working as needed. Image recognition is not an easy task, especially for what your trying to do (sign language), so you will have to work hard on getting it to work first. Also forget the video part for now, just work on a single image.
So, In summary...
1) Use C# to get your processing algorithms working properly on a single image
2) Then test it against video, maybe the performance will be ok
3) Move to C++ if you think you need to
If I am honest with you then I think you are going to find step 1 to be a huge undertaking so good luck...
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
|
My idea is to get a framework going where I obtain a image in bitmap format from my webcam (think AForge is able to do this?). Then I will work on this image till I have my algorithm working.
I haven't done this before, so I'd like to ask you:
1. Can I use a saved webcam "video clip", that is actually just made up of bitmapped images, and use it to test my algorithm? (I was thinking of doing it this way so that I am always using the same functions to work on the data, therefore I don't have to change my functions for video, pictures and RT-video)
2. When attempting the real-time recognition from the webcam, will my bitmap-detection be effective enough, or is there a better format to be doing it in? For example, just doing the detection on each frame in whatever format it comes in
|
|
|
|
|
you can use any source of input as long as you are able to obtain each frame as an image.
In regards to you concern about dealing with different image formats then you could go for converting the images so each one is the same, that will of course add cost to processing but I think it will be very little compared to what you image processing algorithms are going to require.
If I needed to deal with multiple image formats then I would write a class that deals with that and you algorithm simply asks this class for the pixel data it wants to use.
For example I would have a class with the following functions...
public ImageFormat formatForImage;
public Pixel GetPixel(int xPos, int yPos)
{
if(formatForImage == type1)
else if(formatForImage == type2)
}
...Hope that helps explain my meaning. You can choose for this class to work in different ways, you could pass it each frame from the video or you could have it load the next frame itself with the use of a NextFrame function etc.
In my opinion it does not matter what format you work with as all your algorithms will need to be concerned with is the values of each pixel.
I think the best way is have a class like above that can load a bitmap from a given file, then have a function that returns the pixel you want to use.
Then when you need to make it do video you just add that functionailty to the class, then a pixel will always be returned the way your algorithms wants them to be.
Hope that makes sense
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
tvbarnard wrote: from scratch (no API's)
Sorry, this isn't really an answer to your question, but why aren't you using any APIs?
If it's purely because you want to learn that's fair enough, but if this is a real product you should definitely consider using some frameworks to reduce your workload. One of the benefits of OO design is re-usability. Don't waste your time reinventing the wheel.
I mean, you must be using some APIs or are you going to code the user interface from scratch direct bit injections to video memory? And what about capturing the video stream, surely you'll use a library for that, like DirectShow, WIA or Avicap32.
Simon
|
|
|
|
|
No problem
I'm an engineering student completing my bachelor's and I was given this as my year-end project. I am using VS.NET to do my interface and I am allowed to use API's for obtaining the data from the webcam. I have started my implementation using AForge.NET for that (let me know if you suggest anything better).
Other than that, my specs given to me say I am not allowed to use any API's.
I welcome any form of help at this stage (as you can imagine) so you are welcome to give me any feedback from your own experiences
|
|
|
|
|
Well, if it's part of the requirements because they want you to learn about something, that is all right I suppose.
tvbarnard wrote: Other than that, my specs given to me say I am not allowed to use any API's.
I'd clarify that with your supervisor then. Aforge seems like a pretty major framework. It helps with image processing and all sorts. Exactly the kind of thing I would be looking for in a project like this, but if your not allowed to use frameworks you should check this is allowed.
I can't help much I'm afraid, I just wanted to make the point that you shouldn't artificially restrict your self to not using the available libraries and tools without a good reason.
Good luck. It sounds like an interesting project.
Simon
|
|
|
|
|
Hello!
Native code will run faster than managed code. Period.
tvbarnard wrote: from scratch (no API's).
From the scratch, AND with C#? Isn't this contradicting? You will, then end up writing a huge load of native language code and calling it with P/Invoke. While you may have reasons to do everything from scratch, if at all you do it that way, then do it with C++ (or possibly C). Because you are essentially writing your own APIs and such a thing should not be done with C# (you know where these languages stand against each other).
Ideally, you might also want to consider writing the gruesome engine in native language programming and give it a very pleasant UI with C#/WPF/WTF/Silverlight, etc.,
If performance isn't so much of an issue, do it with C#, as it would be much easier.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I am migrating from C++ to C# so I am quite new at it, but I understand what you are saying...
Thanks
|
|
|
|
|
Rajesh R Subramanian wrote: Native code will run faster than managed code. Period.
Umm. Not sure I agree with you there. Badly written c++ code could easily run way slower than well written c# code.
Simon
|
|
|
|
|
Quite obvious! And the no. of processors, clock speed of the processor(s), available physical memory, etc., comes into place.
But, my comment was 'generic', without taking these things into account and assuming the the code is written equally well (on both languages).
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi,
I am making a setup file in Dot Net. I am opening one form during setup for doing some setup in between of installtion. I want to disable or hide the Cancel Button the installation form until and unless user does not saves the value on the other form. After he saves the values i want to enable the Cancel button.
Any reply will be appreciated.
Thanks
Imran
Imran
|
|
|
|
|
Hi all,
I have a printing functions in my C# WinForms (.Net 3.5) application that prints to a printer that supports colour printing.
I am using a custom class that inherits from PrintDocument.
My printed page contains an image and some text. The Image contains colour.
Now, I can print everything just the way I want it to look in colour. But I want to include an option to print in 'Black and White'.
I can handle the text fine as I can just change the colour, but the image is where I am having issues.
I have already tried to set the DefaultPageSettings.Color property to false, this does not work, thou I suspect that is because I am inheriting the PrintDocument class and am expected to handle this functionality myself.
EDIT: I just realised that I am not handling the ability for multiple copies manually but when I set in DefaultPageSettings then it is auto handled as expected so I am now thinking that they is something causing the Color property to not be applied automatically.
I also tried creating a Bitmap with a grayscale pixelformat and drawing the image to that before drawing that bitmap the the PrintDocument's Graphics - This spat out a 'Out Of Memory' exception (admittedly, I could have made an error in the code but I don't really want to take this option anyway if possible)
A third option, which I have not tried yet, is to loop the image's pixels and convert them to grayscale - which is easy enough but again I would rather avoid that effort is possible.
Can anybody recommend the best way to handle this?
Thanks for any answers contributed
UPDATE:
OK, now I'm having what I would call strange results...
If I print the document with PrintDocument.Color set to true the Image is in colour (as expected)
If I print the document with PrintDocument.Color set to false the Image is in colour (not wanted)
If I manually convert the Image to grayscale and print with Color set to true the Image has a slight green tint (due to the greyscale conversion values)
But, if I manually convert the Image to grayscale and print with Color set to false then no green tint (i.e. the printer has printed the image in back and white as wanted!!!)
If anyone can see the logic in that then please let me know, BTW the image to greyscale function is done before passing the image to the custom PrintDocument class
Life goes very fast. Tomorrow, today is already yesterday.
modified on Friday, June 26, 2009 8:39 AM
|
|
|
|
|
try this:
_document.DefaultPageSettings.Color = False
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
before (or should I say after) I try that, maybe you could try reading this[^]
specifically, the 7th line (excluding empty lines)
Life goes very fast. Tomorrow, today is already yesterday.
modified on Friday, June 26, 2009 8:18 AM
|
|
|
|
|
Hi everyone,
Let me ask about some problem.
Is there any way to determine the key press/mouse click is human action or simulation?
If yes, please guide me to the article/links.
Thanks and Regards,
alien
!alien!
|
|
|
|
|
Well, you could perhaps check if the keypresses happen faster than a human could do them, or if the mouse always hits an exact position, but overall, I'd say no.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Some way is there in the Treeview. Suppose if you would like to check whether the operation is perfromed by Mouse/ keyBoard / Unknown, you can do the following
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
if (e.Action == TreeViewAction.Unknown)
{
}
else if (e.Action == TreeViewAction.ByKeyboard)
{
}
else if (e.Action == TreeViewAction.ByMouse)
{
}
}
|
|
|
|