Visual Equalizer Bars in C# Windows Forms [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 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.

Related

"Reading" the information from picture in C# [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 4 years ago.
Improve this question
I am trying to develop code to read out positional data from a picture thats been loaded into the program.
F.E. : Imagine a picture with houses (red squares) connected with lines.
Now what i would need are the posotions of the houses and the lines in such a way that i can use that data and do more with it.
So : - Load Jpg (f.e) into the programm
- Read the picture and save postions
- Be able to work with the saved positional data.
My issue is that i struggle to find the right way to google this. Is it's as difficult as machine learing or is there a more simple way to solve this?
No need to get it explained, but more a place where i can start research this myself would be awesome!
If you want to find contours, you will be interested in Hough Transformation. Check the image on the bottom.
I recommeng getting a hang on OpenCV image processing library (more specifically the EmguCV which is a C# wrapper of OpenCV). It has a fairly big community and it's a project working for ages.
Generally contour recognition and line recognition algorithm are a good shot. You could add opencv to the search phrase.
If you want to detect lines, Canny edge detection would be a nice shot. Once again I recommend OpenCV for this task.

Getting started with Windows 10 Universal Apps [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
I'd like to get a jump start on developing Universal Apps for Windows 10. I thought it would be fairly easy, as 1) Universal Apps are already available for Windows 8.1 and 2) Microsoft keep telling us how awesome they are. I therefore concluded there would be many good examples out there.
I was wrong.
Or: I have yet to find them.
I'm no expert, I'm just a hobby developer. I know VB.net, but have gotten into C# in the later years too. I know the basics and then some for Windows Forms, WPF, asp.net and Windows Phone apps.
I've found several tutorials and templates for Windows 8 Universal Apps (some even on Microsoft Virtual Academy). They are easy to follow and offer explanations on what is really going on and why they do certain things in a specific way. The problem is that these don't necessary work great when trying to convert an app to Windows 10.
What I need is a simple sample with:
The hamburger menu
A couple of Pages with simple navigation
A Settings page that saves the settings
(Optional) A way to save state
Everything I've found so far is either based on Windows 8.1 and can't be ported easily, or is based on Visual Studio 2015 RC or 2013, and something has changed since Windows 10 was released.
I'm used to struggle a bit when learning something new, but now it's like there's a new huge obstacle around every corner regardless of which route I take.
Any pointers? :)
You will need Visual Studio 2015 in order to build and deploy Universal Windows Platform apps, because they utilise NuGet 3.0, and with that, a different package structure. Google "Universal Windows Developer Tools" for those.
For the Navigation Manager, when I started building my UWP app, back in the Technical Preview, I copied the Navigation Helper, Relay Command and Suspension Manager from the Windows 8.1 App Template, and then removed the #IF Windows_Phone and #IF Windows(I believe those are it). Compilation statements (and their containing code For #IF Windows Phone only), although you could probably leave it in, just there is some Windows Phone BackRequested functionality baked in there that I didn't want. It does provide Save and load state functions that you build into the page, if you look into the Navigation Helper Class.
You could instead, check out Jerry Nixon's Template 10: Here, I haven't used it personally because I have already spent over 190+ Hours building my app, it would be a lot of work to switch out the Base (I have already re-written a lot from learning bindings, then x:Bind during development, and I only truly discovered how to make Events and Event Handlers and operating them throughout the app globally just the other day). Template10 is a much cleaner, and probably better Base Template for Making an App than what is provided by Visual Studio by Default.
A Sample of a SplitView APP can be seen here, it is another sample by Jerry Nixon, and it uses MVVM, which is probably a good habit/Structure to learn.
As for saving settings, use ApplicationData.Current.RoamingSettings.Values[_Your Key Here_] = _Object_;
Which serializes and stores it in your AppData as a string in a secure Dat file.
To get your object/value back all you need to do is (T)ApplicationData.Current.RoamingSettings.Values[_Your Key Here_]; T being a generic for the Type of object you want to retrieve from settings. You can learn more from MSDN, Google: "Guidelines for app data MSDN", which should provide you with helpful guides (unfortunately I can only have two links in my post).
Hope that helps

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!

How to detect if any video is being played now? [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
How to detect if any video is being played now using autohotkey, autoit, vbscript, c#, or c?
Video could be being played/streamed in any local player, web based player, or html5 player. We do not know the name of player also player may not be in the full screen.
PS. Detecting CPU load may not give the correct result always, so it is not acceptable.
I've done a small bit of work on this back in the day. There is a WIN32API (old school) that gets/sets whether or not to disable the screensaver (in user32.dll, GetScreenSaverActive(), SetScreenSaverActive - see: http://www.codeproject.com/Articles/17067/Controlling-The-Screen-Saver-With-C). This is the most likely flag to be set when a video is playing but it not 100% reliable as not every player will implement it. It WILL work for most browser videos, whether played through plugin, natively, or via DirectX. This also works for most (all?) external players such as vlc, windvd, etc.
But.
There is no sure-fire, 100% way of determining a video playing. You cannot;
1. Check for sound playing as the user may be using iTunes and not all videos have sound
2. Check for full screen (usually the better option) as the video may be playing in a browser
3. Check cpu/gpu load as it's not reliable and you have no other way to determine
4. Be absolutely sure that the player hasn't cleared/reset the win32 flag when minimized
Another option would be to try and collate a list of possile executable names for all known players (doable but time consuming to find data, espesially on older versions), and check to see if they're running. This isn't 100% reliable either as a plugin by be preloaded but a browser but not actually playing a video at that moment in time.
In short, there's no 100% way that I know of but several ways that'll get you 90-95% there. That is the purpose of knowing if there's a video playing? Perhaps there's an easier way to find what you're looking for...

How do I start doing diagram development in c# [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 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.

Categories

Resources