A route from vector drawing -> c# windows application - c#

I have a requirement to present in my c# windows application a "map" of a building, with different rooms coloured in various ways to indicate various things. This needs to be renderable at different sizes and from different perspectives, and needs not to be a one off exercise, but a repeatable process for different establishments.
I am thinking of it in terms of an old school level editor (think old ID stuff), the product of which can be rendered top down; it sounds like an awful lot of work to get into designing my own editing tool, so am looking for a way to hook an existing tool into c#.
I have got the .NET drawing code down (if need be), and I have got the Adobe Illustrator design down (again, if need be) - what I am looking for is a way to link the two, or (if appropriate) a suggestion to use something different in those two roles entirely. Any and all suggestions very gratefully received, thank you!

I'd look at Microsoft Visio - it seems more appropriate for architectural/schematic diagrams than Illustrator and there should be already .NET libraries to use Visio-generated drawings.

Related

Generating an Organogram in MVC and Displaying in View

I imagine this question will not bear anything, but this is a last ditch attempt before I have to tell my PM I simply can't do it.
My colleague (usefully before leaving the project) was a yes man to everything our PM asked for, regardless of what it was, and I seem to have been volunteered to create some functionality that will generate an Organogram / Organisational Chart and present it in the view.
I have dug around and asked around, no one really seems to know how I would go about doing this. Can anyone offer any advice on anything that can help? Even if it's the most basic tutorial or obscure API ever, it will be helpful.
To put a point on it, my question is: Is it possible to generate a chart in an ASP.NET MVC C# Application, and display it on a View? (Even a yes or no would help)
Yes, everything is possible. It's just a matter of how much time you can spend on it. Not everything has a good return on investment though, but that's for your PM to decide. As long as your team can make an estimation of the complexity.
But for ASP.NET, Microsoft has a Charting library that allows you to build charts. There are also commercial libraries (the first google hit) out there that are more feature rich.
And if they don't work, you can Always build images manually using the System.Drawing namespace of .NET (that will of course take considerably more time than plotting a chart using one of the available libraries). Generated images can be sent through an ashx handler, or you can embed the image in the same page using base64 encoding.
It's not bad to say yes to your PM, but I rather say: "Yes, we will stick this feature on the feature list / back log, and make a estimate of the complexity. Once we know the complexity you can choose to select it for a future iteration." But perhaps I'm talking too Agile now ;-)
You can hand off the chart drawing to an external library, for example, Google Visualization: Organizational Chart
Have a look at this question for other suggested librairies:
What's the best library to draw organization chart using JavaScript?
This sounds like it's in a commercial scenario, so it's really worth looking at the commercially available solutions. Steven already mentioned one, but as far as I can see that one is for Windows Forms and the other one is for charts as in bar charts and provides no organigram features.
A Javascript diagramming library with the capabilities of displaying organizational charts is yFiles for HTML. It has a nice online example of an organization chart that might be exactly what you are looking for:
There is also a Video that shows the demo in action.
The library is a pure Javascript implementation that does not depend on server libraries or servers at all. Integrating it in an ASP.net environment should be easy though, as long as you know Javascript. Being a library it offers full customization capabilities. You can determine the look and the feel of all aspects of the chart. Under the hood the library is a generic graph drawing and editing tool and the organizational chart is just one possible use-case.
Full disclosure: I work for the company that created the library, but on SO I do not represent my employer. My comments, thoughts, etc. are my own.

Beginner C# applications [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I just started learning C#, and I want to start making some small applications that are easy, but powerful.
Does anyone have any projects ideas? I'm interested to hear what you have in mind. Most of my experience is with HTML, CSS, JS, PHP.
Thanks
What do you like doing? I find games are always a cool place to start. If you like game-development you can do stuff like pong and pacman, but you can still have a lot of fun just making board and card games without much of the graphics complexity.
Here's some to get you started:
easier: tic-tac-toe, connect-4, go fish, black-jack, candyland, various solitaire games
medium: monopoly, poker, go, checkers, Yahtzee,
harder: scrabble, boggle, chess, Magic: The Gathering
here's different levels of difficulty:
design the logic. For example, make classes and methods to represent the board, properties, and the players in monopoly.
start making a gui. Make the game actually playable!
add AI and computer controlled players. Obviously AI is a huge subject, so there's many different ways you can go.
see here for a ton more projects on various topics
Since C# can be used in multiple types of applications, I'd try to do the same task in each. Perhaps a simple app that connects to a database and performs a lookup based on user input. Maybe connect to the "pubs" database that comes with the SQL Server samples.
You could do this as:
Winforms
ASP.NET WebForms
ASP.NET MVC
Dynamic Data
WPF
A Console app
using
Standard ADO.NET
LINQ
Entity Framework
You can even create a Windows Service that uses WCF, and a WinForms or ASP.NET front-end that consumes that service.
The idea is to get as many TYPES of apps under your belt as possible, so you can see how each is similar, and how each is the same. It will also help you get a better understanding of the "religious wars" over "which is best, Web Forms vs. MVC", etc. The ultimate answers to those "holy war" questions is invariably "what you're most comfortable with". There's nothing like having actual experience with the various options than to actually write something, so a nice, simple app in all of the available flavors would be a very good start.
And finally, since I listed so many things, here are some great starting points for everything I mentioned. There are videos, walk-throughs, etc to help you on your way.
http://www.asp.net/
http://windowsclient.net/default.aspx
http://msdn.microsoft.com/en-us/beginner/default.aspx
How about a scientific calculator? It'll give you basic experience with GUI building and event handling, it shouldn't be too hard to knock one up and most of your focus will be on the language rather than complicated algorithms (which is what you want when you're just starting to pick up a language.)
I've always heard that a simple game like checkers is good place to start. It lets you handle things like:
Separation of Model from UI (possibly
with a view model).
Skinning of controls or custom controls
and is easy to understand and test.
You can try to create something likes todo list. You can to provide a lot of custom feature for it (save/open data files, import to other formats, UI)
A good place to start is something like a calendar/todo application.
You won't beat all the great programs already out there that solve this problem, but you can start with a very simple but functional program, and add a feature a day for the rest of your life without running out of things you can do.
This gives a lot of opportunities for using different UI elements, doing some custom graphics rendering, serialisation/streams/io, database access, and even synchronising with web-based calendars, etc. i.e. It's easy to find a use for many different .net technologies within an application like this, but you don't need to use them: you can write a basic "useful" application in only a few minutes and keep adding to its facilities to learn new technologies.
Personally, something I'd like right now is a program that performs batch file management operations...
Sorting files into subfolders based on date or name patterns;
Renaming files based on user-defined patterns (e.g. add or remove a prefix from all filenames)
Renaming files based on metadata, if you can figure out how to read it (e.g. mp3 ID3 tags)
Then again, maybe this is too advanced. Or boring. I always find it fun to write a game that is a clone of an existing game, but add a twist. Like 3D tic-tac-toe... bad example maybe, but you get the idea.
Write a graphical dice roller simulator. It should be one window and when I press the "Roll Dice" button it simulates a roll of the dice, showing me an image of how my dice landed. And bonus points if it makes a nice dice roll sound. Extra bonus points if you let me choose how many dice to roll.
I expect to see this by tomorrow afternoon.
Good luck.
Maybe a little more advanced, but I enjoyed creating a little cheating program for playing the bejeweled blitz game. I followed Mike Vallotton's blog to get me started. it's here
Another good one would be to count the number of words in a text file.
Add a little more functionality to it by searching for keywords and returning how many of those were found in the text.
Start with writing a simple program using Form Application using a button and when clicked: Open a MessageBox saying Hello World. Then going over to new stuff like a webbrowser and then obtaining the source code from the site
3 basic steps in learning c# by webbrowser development:
1. create a basic browser that opens up a hardcoded site (site preprogrammed, not decided by user)
2. user controlled, textbox that the user can decide webpage with.
3.pulling out source code and changing every picture on a page for example. That will combine HTML and C# and since you have experience with HTML, changing the client side of the WebPage is good practice.
Good Luck :) Look up ThenewBoston on youtube, really great tutorials on C#
got a couple ideas:
you can make a pretty basic calculator [console application or windows form application]
you can make a dice (give random number between 1-6 or a random number between two numbers selected by the user.
a magic 8 ball, this uses the dice in the previous dot point, but instead uses the randomised integer and prints out the corresponding string.
you can make a planner application (an app that saves data such as todo list on a .txt file, etc).
you can also make a desktop assistant (i made one recently), that recognises voice and speaks to the user. It can also obey simple commands.
if you want to go deeper, you can try coding using C# to create unity games, i had some experience in this, it is very easy (got pretty good at it after reading some documentation and watching some tutorials).
but if you are just starting out, then i recommend you to work your way upwards and start off with making something simple.

How to plot XY graph in C#?

I am developing an application in C# which deals with specific genetic algorithm problem. The execution of the algorithm provides output parameters that are required to draw a chart.The graphic chart consists of 2 independent axis, lets say X is number of generation and Y represents corresponding maximum value of fitness function. To be more specific, I've uploaded picture from Excel so here it is :
http://img97.imageshack.us/img97/2046/graphnb.png
My priority is to make this application fully-functional by allowing user (who sets random execution factors such as mutation percentage, population and generation number, number of elite individuals, etc.) to see generated X-Y graph inside the generated "Form" in C#. I've found site that partially solves my problem, but that's not the whole point (http://csharp.net-informations.com/excel/csharp-excel-chart-picturebox.htm). So I'm asking if there is a way to implement mentioned graph by not using any other applications, but maybe only C# libraries and functions for plotting or something like that? Hope I made myself clear. Best regards.
Free and native answer is http://zedgraph.org/wiki/index.php?title=Main_Page
Does not involve WPF
Does not cost
Only C# libraries
Works inside a .NET WinForm
personally I like XtraChart of DeveloperExpress, but there are also many many other cheaper or more expensive alternatives, also other questions similar to yours here in SO: WPF chart controls
I like to use libraries whenever I can so I can focus on my real business case instead of trying to re-invent the wheel everytime, also because usually it's not trivial to reach the same level of results of people working hard to deliver specific components.
As all have said you have to work on WPF (different platform then WinForms) with 3rd party charting library that are much easier to integrate with your application.
If you want to know further about charting library then you should see this page
Click here
If you can use it, try WPF. It's much better for developing graphically rich user interfaces than standard Windows Forms -- especially if you don't want to use third-party libraries.

A "Google wonder wheel" or "visualthesaurus" like diagram control for .net?

I'm looking for a graph control that works just like Google wonder wheel or Thinkmap visual thesaurus. I don't know what do these types of diagrams called. Any help would be appreciated.
I have a series of non-hierarchical related data entities (should be shown as big and small circles) and I want to show their relation (lines between the circles).
I think you are after this effect, i also dont know if it has a specific name:
http://www.dotnetsolutions.co.uk/successes/wikiexplorer/
http://www.dotnetsolutions.co.uk/assets/images/screenshots/we1.png
thats in wpf so maybe there is source floating around for it - or maybe .net reflector can help you work out how it is done.
I have not seen any components that do this automatically, your best bet is to use one of the many graph libraries on codeplex.com to create a graph like data structure and display it - they have integrated visualisation and graph layout tools included within them.
A few links from my notebook:
http://quickgraph.codeplex.com/
possible component set:
http://visualstudiogallery.msdn.microsoft.com/en-us/494E7990-2722-4A4E-B0E3-AE1F2A831B7E
http://opendiagram.codeplex.com/
http://graphsharp.codeplex.com/
http://research.microsoft.com/apps/dp/search.aspx?q=GLEE#p=1&ps=36&so=1&sb=&fr=&to=&fd=&td=&rt=&f=&a=&pn=GLEE&pa=&pd=
http://wpfgraph.codeplex.com/
http://mgdisplay.codeplex.com/
i'm afraid i've not used any of them in depth so cant recommend one over the other - also be careful as some of them are released under different licenses.
hope this helps
David

Data visualization in desktop applications

I would like to create data visualizations in desktop apps, using frameworks, languages and libraries that help with this kind of task. Visualizations should be interactive: clickable, draggable, customizable, animated...
What I would like to create is something similar to the examples seen here: http://www.visualcomplexity.com/vc/
These are the links I already know: http://delicious.com/laura_laura/visualization?setcount=100
The preferred language is C++/Visual C++ (MFC) because I'm familiar with it, but any other technology is welcome, I would like to make a list from "as similar as possible" to Visual C++ to "very different" from Visual C++.
WPF, flex, Adobe Air, flare, JavaScript (running in a browser as client-side apps with access to local files or as desktop apps) are possibilities, post any good links to examples, tutorials, how-tos, etc. that you know of.
What are the learning curves and complexity for the different options? Which one would you choose and why? Which one have you already worked with and how was your experience? How would you start with a project of this characteristics?
Your post has far too many questions in it to be answered easily in one response, so you might try re-posting with specific questions. Data visualization is a HUGE area of study and it's not significantly different for web applications versus desktop applications.
Put simply, it's the display of data in a way that visually tells the story of the data. It's most useful in cases where the volume of data is such that tabular display isn't effective. Trends, outliers, and abnormal occurrences can sometimes only be seen when data is represented visually. Visually can be a simple chart, or it can be more advanced visualizations such as treemaps or thematic mapping/GIS presentations.
If it's an area you're interested in studying, look into:
Edward Tufte - Author, professor, and all-around guru for the display of information
Many Eyes - from IBM AlphaWorks
Processing - A visual "sketching" language based on Java
Visualizing Data - An O'Reilly book by Ben Fry, one of the co-creators of Processing
Beyond that, I think specifics would depend on what you want to accomplish -- what data is being analyzed, who the audience is, and what the desired "message" is.
If you're willing to use the Flash/Flex/ActionScript/AIR development platform, then take a look at the "flare" library, from the prefuse project:
http://flare.prefuse.org/
I've only gotten my feet wet with it at this point, but so far I like what I see.

Categories