|
Your memory is completely fading now, he wants binary, not grayscale.
|
|
|
|
|
My memory may be failing but last time I checked that article provided a fast way to get all pixel information as well as write out said pixel information. The actual grayscale conversion is trivial when compared to the rest of the code. And if I recall the question, it was how can I quickly ... which the article addresses. As for binary image that is an exercise left to the reader. But then again, if you keep the gray scale logic you can then apply your threshold statement and get the binary result as well.
|
|
|
|
|
Of course.
BTW: he may be needing a dynamic threshold to get acceptable results on more difficult images, e.g. when luminance is varrying wildly.
|
|
|
|
|
Hi all,
Is it feasible to have a single DLL project which targets both .NET desktop and .NET CF through different configurations?
TIA!
|
|
|
|
|
I've never done it, but I can see problems with doing so. Since .NET CF is a subset of the full version of the framework, your .DLL would be limited to code, classes, and methods that only work and exist in the CF version of the framework. You'd be using the exact same .DLL for both devices.
So, just as a result from a thought experiment, I'd say no, you can't.
|
|
|
|
|
From Google and experiment, you can, because you can add a reference to a CF DLL to a full .NET project, so it is possible provided you only need to reference stuff from the CF.
|
|
|
|
|
Plan your project with CF only. It will automatically work with full .net.
|
|
|
|
|
That's what I said.
Yeah, you can make a .DLL that will work on both, PROVIDED you don't use anything that won't work in CF. In that case, what's the point? All you're doing is writing code for the least functional framework. You're not actually targeting different frameworks. You're targeting the CF only, and the resulting .DLL just happens to work on the full .NET CLR.
|
|
|
|
|
Dave Kreskowiak wrote: what's the point?
Well, code re-use, ease of maintenance, etc etc etc. If you don't need anything that isn't in the CF then I would say there's a LOT of point, especially if like me you have classes and data structures that you need to use on both.
|
|
|
|
|
If only it was that easy. There's a LOT more to it than just adding a reference and making sure you don't call a method in the class that isn't supported on CF.
I'll leave it up to you to try a quick test and find out. It shouldn't take you but more than 20 minutes to put together a class in the full .NET class library project, then try it in a CF app.
|
|
|
|
|
Is it possible to create a graphics object in the constructor of a normal calss in order to measure a string? Not using a form or control?
Graphics g = ?
m_nodeSize = g.MeasureString(m_name, nodeFont);
Thanx George
|
|
|
|
|
Graphics g = Graphics.FromImage(new Bitmap(80, 80));
Give that a shot.
|
|
|
|
|
Thank you Kevinnicol
That worked great, i was looking for something like that.
public static SizeF MeasureString(string s, Font font)
{
SizeF result;
using (var image = new Bitmap(0, 0))
{
using (var g = Graphics.FromImage(image))
{
result = g.MeasureString(s, font);
}
}
return result;
}
Did see this example but preffer the below:
Graphics g = Graphics.FromImage(new Bitmap(80, 80));
m_nodeSize = g.MeasureString(m_name, nodeFont);
Thanx George
|
|
|
|
|
gwithey wrote: Graphics g = Graphics.FromImage(new Bitmap(80, 80)); m_nodeSize = g.MeasureString(m_name, nodeFont);
Sorry, did you mean to say that you prefer this version? If so, please don't - use the version above it instead as that disposes of managed resources instead."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:41am.
|
|
|
|
|
Thank you stancrm
I saw this however couldnt find a solution as:
Graphics g;
g = this.CreateGraphics();
Only works in a control or on a form. Not in a normal C# class
Thanx George
|
|
|
|
|
Hi all,
I have an issue and I'd like to find a cleaner solution (as, right now, my work around is dirty beyond recognition ).
This is the structure
"Search" (A web service method) is called by Web Site
"Search" calls two other Web Service methods Asynchronously
Each Async method calls a "Completed" method (one each) and each "Completed" method checks if the other one was finished before it
Once both Async calls have been finished another method ("Connect Results") is called by the last finished "Completed" method
"Connect Results" gathers data from two files (saved from each async method) and joins them into one instance of a class "Final Result" which needs to be returned
BUT since the method "Search" needs a return and because the return line is reached before any of the threads have finished executing, the return is always empty.
So I inserted a while loop (which checks that "Final Result" is not empty) before the last "return" line of "Search" which does nothing except wait for the class to be filled!
I'm sure there's some other way to do this... something cleaner but I can't seem to find it.
Thanks for your help and sorry for the long post...In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
|
|
|
|
|
Hei,
I want to make an installer which can do the following task;
1. Install Dot net fram work 3.0
2. Install CR Merge module 11
3. Install MSDE
4. Create Databes
5. Install Application
what is the best practice or any idea?
thanksSyed Shahid Hussain
|
|
|
|
|
Use the Windows Installer and create MSI files. That's your best bet.
|
|
|
|
|
i have a basic question in linq.
Lets say i have a list of student collection
List<Student> lstStudents = new List<Student>();
Now when i use the where method, i can either specify
List<Student> lstFilteredStudents = lstStudents.where<Student>(...);
or i can specify
List<Student> lstFilteredStudents = lstStudents.where(...);
Now my question is wat is the difference between calling these two methods internally?modified on Wednesday, March 3, 2010 6:45 AM
|
|
|
|
|
None really. The first one is explicitly specifying that the where clause is working against a generic of type Student, where the second version will infer it."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
As far as LINQ is concerned, there is no difference between either of those calls. In fact, there is only one version of that Where method which is generic and looks like Where<TSource>(Func<TSource, int, bool> predicate)) .
In your first call, you are explicitly stating the type to be used in place of TSource and in the second one you are letting the compiler infer the type from the type of the collection.Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Welcome back Scott. I take it the book writing has gone well."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Thanks Pete! Good to be back! Yes, the book writing has gone very well. Four chapters left to be tech reviewed and then the actual publishing process starts. Should be on the shelves in a few months!Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Cool. I bet you're glad to have your life back."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|