Loading Heavy Graphics - c#

I am trying to create a game but before that i am creating all the graphics that will be used in it but here is the problem.
Problem
The current games graphics size is 50MB and might increase as all the graphic work is not done yet and it is not possible to load 50 MB every time when the user runs the game. So, please tell me this if it is possible to downloaded all the graphics on the first run and use it again when the user runs the game again?
If yes then please help me by giving a piece of code snippet or any article related to it. Platform : ASP.NET

Take advantage of all the different caching mechanisms:
Http Caching. You may read more about it here. Especially the section "2. Expires"
HTML5 has the concept of local storage and you can possibly take advantage of that as well. You can read more here.
Try and compressing the graphics. You can read more here. Especially the section "Minimize payload size".
Good luck and hope that helps.

You can download all the graphics on the first run & cache it. This will improve the performance tremendously.
Best practice is to use a CDN/Cache Server.
Refer to the following article for catching: Link & Link

Related

Simple Javascript image editor for ASP.Net application

I'm doing a project on ASP.Net, whose task is to work with images.
So, I need to make the client part of whose tasks will include:
cropping, rotating, resizing.
I saw this topic, but solution are too complicated for my problem (I have only 3 functions, not online version of Photoshop).
Could you give me a free solution for JS?
means that the sending result-image will be executed in Ajax.
Desirable,that solution should support Ie8+.
It is not free, but Telerik has an Image Editor
for ASP.NET AJAX.
Full disclosure: I'm the author of StudioJS
StudioJS (MIT-licensed), (see demo) offers cropping, rotation, flipping, saturation, contrast, brightness adjustment, white-balance correction, and a number of image effects.
It uses ImageResizer (of which I am also the author), to do the back-end work. The ImageResizer core, resizing, cropping, and rotation is free, but the image effects and adjustments require a license. Everything is on GitHub.
If you build your own solution, check out my list of avoidable pitfalls. It can be a bit tricky.
You can use a JavaScript free component to edit the image and convert it to base64 , then it will be ease to save this base64 as a server side code to physical file image
Javascript code :
http://cssdeck.com/labs/xnmcokhc
or by the same way there are many other JS options too in below link
http://www.jqueryrain.com/demo/jquery-crop-image-plugin/
You could use an online editor such as Pixlr. I read it has an API so that you can set it up to work with your web application.It has the features you want, and also many more.
To have your own JS editor, I haven't found something ready available online but could make one of your own.
You could use the imgAreaSelect plugin (is used in WordPress) to make the client side part of the crop function. For the server side part, I have written this article some time ago to describe how a crop function works. You could adjust it to work with the imgAreaSelect plugin. If Pixlr doesn't suit you, let me know so that we can talk more about the second scenario.
So, I've created a SimpleImageEditor for my Project.
I've used ImageAreaSelect for cropping and fc-ImageResizer for resizing.
For display I use Bootstrap 3.0.
https://bitbucket.org/Dr-klo/simpleimageeditor/

How does Gmap.net cache works?

I´m using the GMAP.net library in a project and I found it was a powerful tool. It´s cache facility made it a real profit to my project. Anyway, I need if someone can tell me a little bit of how that cache works. As far as I tested it, I can see that it pre-allocates space (in my case about 200 mb on SQLITE file), so I started doing some test seeing how it worked, and it turns out it works really well, but in some cases I have been viewing maps that haven´t been cached. I don´t know if I have to spent some time with the position on the map so It can be cached or something like that. Does the tile cache file size increases with the time?, or it just keeps the prealocated size?.
Thanks in advance for any possible answer.
I've been doing some research on this same topic. I learned that the application by default has a gmdb of 256mb. This doesnt mean that there is 256mb of cached map. It just creates room for the cache data. Look at this post by Radio man for more clarity. Hope this helps. If you find more info post if for others because there is a lot of missing info on this topic.
http://greatmaps.codeplex.com/discussions/274628

SilverLight: How to record a video from a web camera

I have searched how to use SILVERLIGHT to record video for days but got no luck.
Most articles related to SL only talk about how to record audio or snap a picture rather than recording a video file and save it somewhere.
And I found there is no resources about it on Internet(I am surprised!!!)!
So could you provide me an example code with proper explanation?
I am waiting for it.
PS: I do not want to use Flesh as none iPhone nor iPAD supports it.
Thanks
Fortunately, Mike Taulty's source code can easily be updated to work with Silverlight 5. You can download the fixed source code and try it out (Disclaimer: all code courtesy to Mike Taulty, I merely fixed SL5 compatability and ran a cleanup). Use your favorite diff tool to see the changes I made.
I have tested it, and it generates video files that can be viewed in VLC media player (after selecting build index to fix the corrupted index). As the file format is not 100% correct, the files can not be opened in Windows Media Player etc... but I'm sure that can be fixed.
You should, however, be aware of the fact that Silverlight is not supported on iPhone, iPad, Android, and Windows Phone (Windows Phone apps are made on a special version of Silverlight, but can not run Silverlight applications in the browser).
Unfortunately, after undergoing hundreds of hours researching on the possible solution, I finally found the answer in a book called: Pro Silverlight 4 in C# (Matthew MacDonale, APress).
According what is said on the page 436, although you can do it with Silverlight 4 (you have to write your own file header helper, store the row data as byte arrays and later on you have to convert them into a raw video data and what is worse is the audio and video are separated.), it is just not practical and worthy to do it. Because it requires reams of complex, handwritten code to convert it, and the conversion process is computationally expensive, which makes it extremely difficult to do in real time.
So I guess this would be the conclusion of my question. Now what seems still make sense for me is to find out why Microsoft doesn't support it and what is the new technology which is going to be used/ has been used to replace the SL.
Is it HTML5? But as far as I know, there is only a video tag in HTML which can only be used as a video player, but no tag to support to get the access of a web camera and save the captured video+audio at the same time as one file onto somewhere which could be a local hard drive or a network storage.
I hope all dear you could come up with some thoughtful advice.
I am going to leave this question un-answered for a few days to see whether there could be someone who can come up with some fantastic solution.
Thanks again.

Monotouch - select multiple photos

Is there a way to do this in MonoTouch?
http://definelabs.com/blogs/?p=17
I don't understand much of that Objective-C code...
I wrote an article on this: Accessing iPhone Album
I know this is an old post, but there is a demo app that I've created that lets you do the features Nicklas Savonen requested.
What this demo app does is, it will get the list of images from AssetLibrary and will load them in a UItableview, then maintain a selection status, the Tick image is just an overlay image that will be hidden/visible based on selection.
The following link explains the basic steps you need to take, since it would be difficult to understand by the project:
http://helpalittle.wordpress.com/2014/03/28/monotouch-multiple-image-picker/
And you can find the complete solution at the following path: https://onedrive.live.com/redir?resid=697F540B0A2F1506%21107
hope this helps.
I know am not helping much at this point, but you need to learn at least a bit of ObjectiveC to be able to read it. The issues is, that all the samples and plenty of resources for iOS development is in ObjC and converting it to Monotouch is not that complex, in fact all the constructs there have C# equivalent (the blocks in the sample you posted, are in fact anonymous methods).
More to the point, multiselection of the images is done in the iOS SDK 4.x, if I find some spare time this would be a nice little exercise for my blog.
As to what APIs to check for this, these are asset library APIs:
ALAssetsLibrary & ALAsset & ALAssetsGroup
in Monotouch there are classes in (pseudo code):
using MonoTouch.AssetsLibrary;
MonoTouch.AssetsLibrary.ALAsset;
MonoTouch.AssetsLibrary.ALAssetsLibrary;
MonoTouch.AssetsLibrary.ALAssetsGroup;

Multiple Image Uploading / Map Images to Products

I am looking for a solution (APIs, etc.) for handling a similar experience as cafepress.com. I need to be able to upload images (preferably multiple at a time) and be able to map my uploaded images to various product images (clean stock images of shirts, mugs, etc.). I also want to give the user some very basic controls over the images they upload such as cropping, resizing, levels, etc. Any suggested libraries or APIs would be greatly appreciated. I am looking for .NET solutions (if server-side). I am not looking for how to tie this all together but rather some suggested libraries or tools to build out some of this functionality.
Note: If this is not the place for this type of question, please move accordingly or suggest an alternate site.
Frankly, I don't think you are going to find what you are looking for specifically, unless you are looking at using a full on CMS of some form. Frankly, those problem domains are too far apart. Instead you should probably look at them as individual pieces.
So far as upload controls exist, there are probably close to 100, some free some not so free. Personally, I already have a Telerik subscription, so it was a no-brainer for me, but Rad Upload works well and supports multiple uploads. Free implementations are available.
The cropping and post image handling tasks ( at least the ones you have listed ), can easily be handled using standard System.Drawing.* calls, or if it gets more advanced a ton of free libraries exist, like the age old ImageMagick, but there are a number of commerical libraries available as well. Chances are though, the inbuilt libraries will be more than sufficient.
Finally the mapping to products should be handled by your business layer ( aka, code you write ) as it is going to be so specific to your app.
However, if you are looking for a storefront or CMM with a multiple image upload control, that is a very different question with many options as well, both free and commercial.
use openCV. you can find it here: http://opencv.willowgarage.com/wiki/
you can use this library perfectly with c++.
if you need to use it in C# use this wrapper: www.emgu.com/wiki/index.php/Main_Page

Categories