Playing Flash swf files in XNA - c#

Is this possible? It would be great..
I've tried:
http://fci-h.blogspot.kr/2007/06/how-to-play-flash-swf-inside-c.html
which gives me a attempted to read protected memory error
and
http://blog.debreuil.com/?p=35
which I just can't work out how to use - I just want the code to play a .swf file I've made already in my XNA game.
I would just love to be able to do cutscenes or live backgrounds in this way, especially if they can be streamed from file instead of preloaded.
Thanks a lot for any help!

Sorry, but this is not possible without extreme hard work that's just not going to be within your reach. (Or some painfully awkward method, like embedding a Webpage below your game)
On the bright side - there's pretty much no need for .swf embedding. Anything flash can do, XNA can do better!
Use animated images or videos for live backgrounds / cutscenes - or program them yourself in XNA using manipulation of static images - if you need help with that, post a new question asking for help with some specific thing you need done.
Also, if you want, you can ask for help converting Flash Actionscript to its C#/XNA equivalent - it can be done without too much work by anyone with a little experience in both languages.

Related

problems with accessing webcam output in c# application

i know this is most likely a duplication and i am truly sorry for that but most of the solutions i found was either +7 years outdated, bugged or consume so much memory
all i need is an efficient way to access the webcam to record and display to use it in a computer vision project to detect moving objects and such, with an HD output (using HD camera of course)
also if there is a library that would help with the computer vision that would also be great
any information, tips or experience would be highly appreciated, thanks in advance and have a wonderful day.
You could use AForge.net, it's available as a nuget package and gets the job done.
Here is an example of it. It's a winform application, but I use this library in WPF app as well.
[EDIT] Actually, I think I found what you're looking for, download this. It's a piece of code that has been written for a french azure contest. It's a motion detector written with aforge.net. There is 2 part to it, the first is a wpf client that capture movement. The second is an azure website where the image captured is uploaded automatically.

Screen scraper for creating a log of gathering in a RPG

I want to create a program that can log gathering in a RPG for me, the problem is that I dont know where to start. I know c++ and some c#, but I haven't got a clue on how to scan the screen.
What I've looked at:
Screen scraping (most info is on scraping HTML pages)
OCR (Most info
is on OCR on a image file, not an active window)
Spy++ (I haven't got
a clue)
I can do it with any language, but I'd prefer c++ or c# since that what I'm most experienced in
What is the best way to do it? anyone got some helpful links/tips?
example of something I'd like to know (amongst other things):
Would it be wise to make a screenshot like once every seccond and then analyze that image?
Should I learn and use windows API for this?
before you bash me:
Yes, I know that this will be a big project, nothing I expect to complete easily
Yes, I understand that I will have to learn more about programming to do this (that's part of the goal)
Yes, I understand that it might be more than I can handle at my current level of skill, but I'd like to figure that out by trying :)
Please help me, I really dont have a clue about where to start
If you are serious about creating this program I would suggest you forget about scanning the screen, image analysis gets very complicated very quickly.
Instead look into memory reading, the information shown in the game can also be read as a straight up value from the games working memory.
There are probably resources out there for your game already, google it.
World of Warcraft
Diablo 3
etc

Suggestions for a video montage application (extracting and playing randomized short clips from a playlist)?

I'm an electronics engineer used to coding in embedded C and assembly, but I decided to start learning higher-level stuff like C#, .NET, etc., so I can start making software as a hobby. I have a great idea for one of my first projects, but after searching several forums for days on end, I'm left not really knowing what would be the easiest path forward.
The functionality that I'm looking to create is pretty similar to the idea of a photo slideshow, but applied to videos instead. The program would open a playlist or a folder full of videos and then play the videos in a random order, starting from a random starting position, and with a fixed duration (let's say 10 seconds as an example). You would end up being able to watch a sort of "video montage" that consisted of small clips from random parts of the videos in the playlist, shown in a random order, ad infinitum until the program is closed.
There are a number of ways I could tackle the problem:
Develop a standalone video player with the fixed functionality of showing "video slideshows." DirectX has the Microsoft.DirectX.AudioVideoPlayback API that
could be a good starting point. I found an example here: http://www.dreamincode.net/forums/topic/111181-adding-video-to-an-application/
Modify an open source project to add the desired functionality. I've seen a few cool projects that could get me started, like this simple C# Movie Player: http://www.codeproject.com/Articles/18552/C-Movie-Player
Use a scripting interface to implement this functionality on an existing media player, like VLC or Winamp. You could also control VLC via C#, like the example here: Controlling VLC via c#
I realize that the obvious answer for most people would be to "use whatever you're most comfortable with," but since I'm a pure beginner, I don't really have any allegiances to a particular language or development environment. So, I was just curious if anybody had an idea of what might be the least painful option for a beginner.
I also apologize that this is not a very specific programming question. I'm sort of just testing the waters to get my footing. Hopefully, once I get started on the project, I'll be able to come back and post more intelligent and relevant questions!
While your background would lend you toward C#, I recommend investigating something like this and using WPF for the media player. You can then control the media player using a background worker in order to stop the video or queue up the next one. Some other .NET concepts that will be of use to you are FileInfo and DirectoryInfo objects, to provide you with the necessary information about the files. I'm not sure if you've had experience with generic data structures in .NET, but the System.Collections.Generic namespace would be a good place to start to get a feel for data structure you want to keep your playlist in. WPF will also be able to help you with transitions between video clips.
Admittedly WPF is easier with an understanding of the MVVM or MVC design patterns, but I think you'll be able to get something working without having to delve too far into that right up front.

video call in c#

I want to make a similar application to Skype, and the main problem is working with video and audio. The first problem is how to get a bytes array of the video (to be specific, I need to get bytes which represent the video, so that I can send them over the internet), and same with audio. The second problem is to play bytes that come from the other computer.
I've been thinking to do that in WPF. I'm new in WPF (I have practiced a little bit, and made couple of programs among which is a basic chat program). I'm doing this for practice, and I want to code by myself as much as I can, server, client, transmision of data, and so on...
I've been searching over the internet, and only one solution seems to me to be good, or better to say feasible, is to use DirectShow.
Just to add, I know that camera and microphone is supported in Silverlight, and I've tried that (actually, I've tried to host an HTML page with silverlight project in WPF project in which were webbrowser control, and I've succeeded to show video from my webcam), but I don't know how to get bytes which represent video.
Is that possible to do with WPF or silverlight?
I'll be very grateful for suggesting any solution, advice, or useful links.
Using DirectShow filter graphs, you'll have a direct access to image and audio buffers from input devices (such as cameras and microphones) as bytes array, sample by sample. You'll be able to directly manipulate the data, to chose a coding or compression format (using specific filters), and to control the data rate and synchronization.
However :
if you've entirely new to this environment, it will be hard. Also, I know it works nicely with C++, but I've never coded any Directshow application in C#. (You may want to look this way : CodeProject Tutorials, MSDN DirectShow topics, and tests using graphedit)
streaming media accross a network and receiving it with Directshow is not trivial and can be quite a pain. Network renderers and network source filters are available all around, but are always difficult to use in my opinion. And depending on your video format (H264, MPEG, MJPEG...) and network protocol (RTSP, plain old simple UDP...) choices, you might end up having to write your own stream/source filters, which is hard and time consuming.
Nevertheless, it IS feasible, and if your main objective is practice with coding, then why not !
(Never used WPF, maybe it's actually way simpler !)
I can't speak to WPF or Silverlight, but I've done this in DirectShow, and it's a pain in the ass.
If you want to use .NET, there's an open source wrapper called DirectShow.NET, that helps alot, and it's still a pain in the ass.
Microsoft did a good job with DirectShow and the whole Filter-Graph thing, but then they sort of dropped the ball a while ago and haven't updated it in years.
I'd recommend looking for a different technology(although it probably sits on DirectShow), and I'd be interested to hear what you find.
To all who are interested in this subject,
After spending hours and hours searching the internet, i managed to find a solution that should work. With Silverlight i take captures, resizing them to 160x120 (or less), and than convert them with imagetools. One thread that is responsible for taking pictures, starts capture, and when it is finished (capturing is asynchronous, so you need semaphores to use) it sleeps for 200ms; thats almost equivalent to 5 frames per second. I'm doing all of this because i have slow upload bandwidth, about 16 kilobytes per second, so i have to compress one frame as much as i can. Result is low detailed picture, but if u use 100x100 rectangle for viewing it, it isn't too bad. I haven't tried it with the internet yet, but, as i have said, it should work. I've also tried using compress methods, to compress picture a little more, if it is possible, but i don't know how to use that class (something is not working well), so left that for another time. Now i just want to make it work, and latter i'll try to make better performance.
Oh, one more thing, I also have to solve problem with audio transmission, and that needs a lot of work.
So, hear latter.

Where can I find, or how can I build, a cartoonizer for C#?

I am working on the development of a Massively Multiplayer Online Role Playing Game (MMORPG) in .NET using C# and Silverlight. One of the features that has been requested for this game is to allow players to upload their own avatars.
Rather than displaying the uploaded images in their raw forms, we want to convert the images to a cartoon form--in other words to cartoonize the image.
Several sites which can accomplish such a task are listed at http://www.hongkiat.com/blog/11-sites-to-create-cartoon-characters-of-yourself/
I realize that these sites are applying an image filter to create the cartoon image. Frankly, I have no reasonable idea what these cartoon image filter algorithms might look like or if there is anything already available in C# or .NET that I could use. If there are no libraries available, I am curious how difficult it would be to roll my own.
This is a minor game feature so I am not interested in devoting a week or more of coding time to implement this. However, if I can code up what I need within a day, then it is probably viable.
At this point, I am primarily looking for guidance as to
what is possible
what libraries are already available (preferably as open source)
where i may find additional information
any other advice or guidance you may be able to provide
Thank you in advance!
Apparently you apply a Gaussian Blur filter to the image. Then you sharpen the image. Perhaps the AForge libraries would help you out.
I've used code from the image processing lab on code project before with success. (update: here's the library it uses)
Christian Graus also has written a whole series on GDI image processing which I found useful (and has the effects listed above for filtering capabilities).

Categories

Resources