How do I start doing diagram development in c# [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'd like to try to create a diagram making tool (something like entity-relation diagram you can create in SQL Server 2005, or class diagrams you can do in Microsoft Visual Studio)
Ie. I'd like to create boxes, put text in them, be able to edit this text and draw lines between boxes.
I never did this kind of programming before so I don't know where to start.
Do I use XAML or create a canvas and go into graphics programming?
I know there are some diagram tools out there but I'd really like to find out of these things by doing it myself.

WPF/XAML are a great place to start for something like this. You'll want to study WPF in general, with a focus on custom controls (for tables) and drawing lines (for the relationships.)

Well, here is the basis of one on CodeProject, with source and a tutorial. For WPF.
Also see this question.

The rendering engine you pick is somewhat arbitrary - you're going to have to do a lot of work no matter what framework you use.
Having implemented such a system in C# and WinForms, I can honestly say that's a bad route to go. Stick to WPF/Silverlight. Going with trends, write a Silverlight 4 app so you can deploy to desktops on multiple platforms.
I found that there are a lot of high-level decisions that you have to make that are even more important than which rendering engine you use. Some of these are:
How much do you need to zoom and pan around?
Do you want continuous zoom so that you can do neat animations to the data?
Do you need to be able to pan with just the mouse?
How will you distinguish pan movements from dragging around boxes and handles?
Will you change the layout of content in the boxes dependent upon the current zoom level? or will you rely on font scaling?
Do you need grouping? Once you get a few tables on the screen you will soon realize that being able to hide some detail is useful. Being able to group boxes and to show that group in iconic form as "meta" box allows the user to get rid of unwanted distractions.
Do you need search? Again trying to combat the "too much on the screen" problem, it's good to have a search box that hides everything that doesn't match the search (gray out, hide, etc.)
How will the user interact with the keyboard. Since your audience can include programmers, you're going to want to give a lot of thought to making all your diagrams editable with just the keyboard. This means things like handling focus intelligently along with which hot keys to use.

As Frank has pointed out - creating interactive graphics is big business. Many companies have already been there, spent £millions perfecting it. It would depend upon how much interactivity you want. I would advise you pick a graphing application that is extensible or has an API - that suits your budget. The better ones are (in my opinion) in the CAD domain, such as AutoCAD (£4k/seat), TurboCAD, VeCAD (£200/seat); and all have packages that allow you to resell their product within yours.

Related

Build-in resizing tools for controls?

I'm trying to make a small program where the user could resize the controls by dragging the border.
Much like many editing software, such as Office, Paint 3D, or even VS itself, would do.
I learned how to do it from this article.
But how can I make it more "professional looking"?
Because in all the editing software, "little square dragging handles" will appear once you select the control, just like the following picture.
I had thought about maybe change the background image upon mouse enter, but then I thought, "since VS have all that functionality when you making a form, there must be a way to employ it directly, right"!?
But unfortunately I can not find any documents online related to it! Probably because this is "not" something most of the people would do and requires more professional knowledges.
So, could somebody please be so kind and help me out!?
Probably through some using or importing some dll or something, much appreciated!

Visual Equalizer Bars in C# Windows Forms [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
For my college project, I have decided to create a rhythm game which is similar to Beatmania, with notes falling from the top of the screen to an area where the user needs to make an input.
Now, for the main menu, I would like to include a visual equalizer, with bars moving up and down in rhythm with the music that is playing in the background:
This would need to be customisable to be added into the main menu (transparency so that background behind the bars is visible etc.
Currently, I have been looking all over the internet to try and find a way to program such a thing. However (unless I'm using the term wrong), all results come up with actually equalising sound based on bass etc. and since I'm somewhat of a C# beginner I am baffled as to what is said.
XNA Visual Equalizer Video - this is the closest thing I have found to what I would like. Unfortunately, I have no idea how to use XNA and there is a chance that my college will not install XNA, so working on the project will take longer, as I can only work on it at home. So Windows Forms would be preferred.
Any input on this would be appreciated. If you have any questions then please ask :)
Edit: (Not sure how to narrow this question down) - I need a Visual Equalizer in Windows Forms, does Windows have such a method, class or reference that can be used right off the bat without having to download plugins, extensions etc.?
What you are looking for is called an Audio spectrum analyzer. XNA is commonly used in games, and should just be included as a .dll in your files. I don't think you have to install that b/c you can publish XNA content as a native executable.
However, instead of reinventing the wheel, the nice folks at code project have shared a project that analyzes the frequency of sound. You should be able to modify this and get it to work to your specifications.

How to draw Windows-style folder icons that preview the contents [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have a C#/WPF application that displays collections of components. I want to know how to create an image that is styled like the Windows 7 folder icon, where one or two of the content thumbnails are enclosed by a yellow leaf folder. (The collections I have aren't real Windows folders, and their contents aren't real Windows files)
Google Approach
I have spent a fair amount of time searching for code samples on how to do this, or anything even remotely similar. I can't find a single example of anyone doing this, which has truly surprised me. It tells me one of two things:
I can't find the right keywords to search on (combinations of: thumbnail, windows, c#, wpf, icon, folder)
Nobody else has ever wanted to do this, and that's because there is a better way of doing what I want to do.
Coding Approach
I can see that there might be a back image drawn first, and then skew transforms applied to each content thumbnail, overlaid, and then finally the front image. I've seen some code examples that show how to skew images, etc. There are some very subtle effects being drawn here too (shadows), though they could be "canned". I'm not sure how to separate the example images below into a front and back portion, though I could give it a try in Photoshop.
Windows API Approach
The closest approach I've been able to find without coding this from the ground up is to write a component's thumbnail to a real Windows .PNG file, inside a real folder, and then use Windows.Storage.StorageFolder.GetThumbnailAsync() to get Windows to do it for me. Obviously this makes me die a little inside, but it might be the quickest way to do this.
Can anyone help me? Ideally I am looking for a library or existing code sample that could show me how to generate these. Otherwise, I will attempt to code this myself using the coding approach outlined above. I'm not looking for someone to write this code for me, but I would appreciate any pointers.
Thank you!

Creating SPECIFIC Dynamic Visuals - House Plan w/ Objects (FOLLOW-UP)

Yesterday, I asked a question about how to dynamically render something in .NET: specifically, I asked about how to create a white "canvas" for "drawing"/rendering upon, what framework to use, etc. However, many of the answers suggested for me to ask a more specific answer, so right now, I have come up with a completely hypothetical (and random) example of what I want to accomplish.
The example is as follows: let's assume that I'm trying to create an app where the user can first draw some rectangles (by clicking or entering dimensions) to create the outlines of their house. Next, they would be able to draw small rectangles inside to signify objects inside the house. Also, they would be able to pan or zoom. (Don't forget, this is a completely random example.)
So, if I were to try to do this, I guess I have the following questions:
How do I create the white "canvas" for drawing everything upon? Some answers to my first question suggested using WPF, and I want to try that. Is there a specific control I need to add to the XAML to allow me to render such dynamic stuff on top of it?
How can I draw/paint figures like these onto the canvas, and how can I change this during runtime (panning/zoom)?
Do I need to create a simple coordinate plane for referencing and storing all the objects and their locations inside the "house"? If so, how?
I hope this isn't too general still, as I think that using such an example would allow people to effectively answer this question. Thanks!
HTML makes a great blank canvas.
Many games utilize OpenGL or DirectX for more advanced (eg. panning/zooming) features.
Unity is a pretty decent platform for such things from what I can gather about it.

How can I make a product showcase in Silverlight?

I can place a couple of buttons in Silverlight, but I'm not that experienced with the Silverlight tools and capabilities.
What do you think I should use to create something like this?
The control would have to pull and ID from the database and according to that place an image asociated with the record.
I need it to be animated with some crispy movement.
How can I achieve this?
It's all possible, but you need to break the task down into smaller steps.
Once you've done that you should find that you can solve some of these with your current knowledge, others will resolve themselves with a little more research, but there will be some you need to ask questions about here.
I'd suggest you start that break down and try to solve the little problems. Then if you get stuck come back and ask more specific questions.
Well, with Silverlight and c# you can make the animations needed and such, and you can set a Silverlight Image control with a data bound source, so it loads the images dynamically, but Silverlight can't talk with databases directly, you'll need to use a webservice to interact between Silverlight and the database. Don't know how much you know but to not leave anything out, with Expression Blend you can make the graphical part of you're app fast and easy, and with Visual Studio you'll add the code-behind and functionality.
In this link you can find a example of how to make an image slide show with Silverlight, it may not be exactly what you're looking for, but it should give you a heads start.

Categories

Resources