|
Posted
about 14 years
ago
by
JaCraig
OK, I've figured it out (I think, or at least I was able to get the same error message). I believe you're using the individual DLL for Utilities.Media. It appears that there is indeed a bug as it should be compiled
... [More]
with [assembly: SecurityRules(SecurityRuleSet.Level1)] in the AssemblyInfo.cs file. It wasn't (I tend to use the full DLL in my apps so I missed this one). I'm going to push to the source code a fix tonight. If you're using NuGet, I push a nightly build to it around 8PM eastern time (assuming it passes the unit tests). Otherwise you'll need to either use the full library (which doesn't have the issue) or pull the code from source and compile it. [Less]
|
|
Posted
about 14 years
ago
by
Antiath
Unsafe code is allowed. I was already playing with unsafe code before trying to your functions. This is why there is a call to lockbits in the snippets above. It's just a ghost from a previous version of the app that I forgot to remove. When trying
... [More]
with a 24 bpp bitmap , I was locking the image in order to convert from 32 to 24 bpp and unlocking it before calling the sobel edge detector. But nevermind, consider that I just load the 32 bpp bitmap, and then call your function with unsafe code properly allowed. This is enough to trigger the exception mentioned above. [Less]
|
|
Posted
about 14 years
ago
by
JaCraig
First, make sure that you're allowing unsafe code in the app whenever you use any of the bitmap extension methods (go into the properties of the project and it should be an option under Build that says "Allow unsafe code"). Also you don't need to
... [More]
lock the image. Actually locking the image may cause an issue but not the one you're experiencing as each of the extension methods uses "unsafe code" in order to get a speed increase. [Less]
|
|
Posted
about 14 years
ago
by
Antiath
Hum sorry this not the correct code. You can remove the line with the lockbits method. I just forgot to remove this before posting. Of course, the error is still there.
:/
|
|
Posted
about 14 years
ago
by
Antiath
Hi,
I have been trying your edge detection methods on a simple .bmp image . The image is a 32 bpp bitmap. I properly referenced to Utilities.Media.Image.ExtensionMethods in order to use SobelEdgeDetection() on my 24 bpp bitmap. It compiles
... [More]
fine ( under .NET 4.0 ) but when debugging the app, Visual studio stops at the call of SobelEdgeDetection(), triggers a VerificationException and saying " This operation could destabilize the runtime". I tried to set the security level to 1 using [assembly:
SecurityRules(SecurityRuleSet.Level1 )] in assemblyInfo.cs, but it doesn't change anything ( level "none" isn't accepted ). Here is the code :
unsafe private void Start_Click(object sender, EventArgs e)
{
Bitmap bm = new Bitmap(@"C:\Users\Floent\Documents\Arduino\ASCOMCamera\1StarC1.bmp", true);
Viewer.BackgroundImage = bm;
BitmapData bmd = bm.LockBits(new Rectangle(0, 0, bm.Width , bm.Height), System.Drawing.Imaging.ImageLockMode.ReadWrite, bm.PixelFormat);
Bitmap bmfilter = bm.SobelEdgeDetection(); // Debug stops here.
}
I also tried with an image converted to a 24 bpp bitmap using the lockbits method. But still, no change. The Laplace version of the detector fails too with the same error.
Could you help me on that please ?
[Less]
|
|
Posted
about 14 years
ago
by
James Craig
Removed tag github/master
|
|
Posted
about 14 years
ago
by
James Craig
Removed tag github/master
|
|
Posted
about 14 years
ago
by
James Craig
Just realized I was storing suo files...
|
|
Posted
about 14 years
ago
by
James Craig
Merge
|
|
Posted
about 14 years
ago
by
James Craig
1) Updated copyright stuff...
2) Removed Parameter classes from MicroORM and ORM code. Instead added various Parameter types (equal, not equal, and, or, like, between, etc.) under SQL namespace that both bits of code now use (also usable with
... [More]
SQLHelper now, but generally would only be used by MicroORM and ORM).
Note that #2 will break some code, but just switch your Parameter<Whatever> to EqualParameter<Whatever> and you have the same thing (also I added parameter types specifically for strings so for strings, you'll need to use StringEqualParameter<Whatever>). But this change adds a lot more depth to the querying power of the MicroORM and ORM and lets me expand this in the future as needed. [Less]
|