Quickest way to read through a picture? [vb.net 2005]
In VB.net 2005 what is the quickest way to read through an image? I currently have a class taking images from my webcam then it processes them and does stuff with them.(sort of like filters) I'd like for them to move a little smoother...
Is there a quicker way to go through an image than to just go pixel by pixel? While still keeping quality? Because I know I can make it go average of every 10 pixel but the webcam images are bad enough quality I don't need that making it worse...
Is there any other way?
Thanks,
Alex
Re: Quickest way to read through a picture? [vb.net 2005]
I know this is old but I still have not found a solution. Any ideas?
Re: Quickest way to read through a picture? [vb.net 2005]
It'd be alot easier if we knew exactly what you are doing with the image. If you are applying a color to the image it could be done extremely faster with the help of the ColorMatrix class.
If you are using the data of each pixel in another way, and want to use 100% VB.NET, you'd use the LockBits method of the bitmap to lock it into memory, and read/write pixel data directly from memory using the Marshal class.
If you wouldnt mind using a second language, you could write a DLL in C/C++ to process the image. This would be alot faster than using only VB.NET
Re: Quickest way to read through a picture? [vb.net 2005]
I could do a DLL that is written in C++ I'm not sure how that works though? But what I have right now is a program that uses a class I found to take input from my webcam. From there I turn the pixels that have a red value less then a threshold black and above that red. It's just experimentation currently in playing around with a live filter for my webcam. But without the filter its fast as hell and when the filters are added it's disgustingly slow lol. So how would you go about writing the DLL in C++? I know C++ but not sure how to do the DLL?
Thanks,
Alex
Re: Quickest way to read through a picture? [vb.net 2005]
Create a C++ Win32 Project. When the wizard comes up, select DLL as application type and check the "Empty project" checkbox.
In order to create functions that'll be available for others to use you need to export the functions, like this:
C++ Code:
"extern "C"{
__declspec(dllexport) void MyMethod(int someParameter){
// Code.
}
}