Basically functionality i need is:
easy integration with ASP.NET application.
user ability to crop image with handle prior to save
image optimization from any image type to jpg (compression levels) during the save
saving images with proper h/w ratios during the save
user ability to rotate the image prior to save
ability to translate application to foreign language as it won't be used on international site
If you know any application which fits my needs even if it costs money, give me a twit...
Our company has implemented a photo cropper in an ASP.Net MVC application using Atalasoft's DotImage. I did not implement this myself, but I currently maintain the whole of that application (and consequently the cropping component).
Based on the way you phrased your question, I feel that I should explicitly point out that Atalasoft's DotImage only provided the functionality to manipulate images. Other answers referenced ImageMagick and GDI+. In the same vein, these libraries also only provide the functionality to manipulate images.
We had to implement the UI and workflow ourselves. This was, while not rocket science, still far from trivial. While we used a pre-built component for fancy, AJAX-y file uploads (for the source photos) - we still had to integrate that into the application and manage persistence of the files and database records associated with them. (Similarly, as a convenience we allow import photo from url - another feature we had to explicitly create)
I would suggest that you will not find any general purpose component to integrate that will give you cropping functionality and a Web UI. I suppose there may be one made by a ASP.Net component vendor, but I am certainly not aware of any off-hand.
The problem tends to involve lots of pieces that span from the client to the server, and consequently I think what you are looking for will involve a fair amount of specific-to-your-application development and integration.
You can try ImageMagick, it supports hundreds of image formats and it comes with a .NET wrapper.
Have found exactly what i was looking for iLoad
Does exactly what i asked and doesn't cost that much compared to other suggested solutions. Haven't tried it yet but demo is impressive.
Have a look at mcImageManager
Related
Please note that this question has nothing to do with hand-writing recognition. The user could draw random doodles for all I care. What I want to achieve is to extract a set of vectors from the image that can then be used to generate scalable approximations of the same drawing.
I mention hand-writing/drawing specifically because it involves a vector-friendly operation rather than any arbitrary image (in which case a simple raster scaling algorithm would do).
Once vectors are extracted, you could then represent them in any number of ways such as SVG, etc. Looking for something simple to get started with. I'd be happy to hear any suggestions irrespective of programming language.
I guess you're looking for raster-to-vector conversion, which is a feature of e.g. Photoshop. Google finds lots of hits but there is some GPL C++ code on the first link of this page. Also take a look at this Wiki page for some more options.
Although they are C/C++ rather than C#, you did say you don't mind about the programming language, so I would look first at:
Potrace (Wiki page here and web site here), and
Inkscape (Wiki page here), which uses Potrace and also supports SVG
Both of the above are open source and cross platform so the code should be generic enough for conversion to C# if necessary. The main Potrace page lists an existing C# conversion called Vectorization. Alternatively you could consider making a C++/CLI assembly to access the native code from .NET.
From the Potrace example, page, you can see the kind of conversion possible:
I am creating a photography website so I have stopped browsers on PC/Macs from being able to download the image. When I viewed the site on an iPad, I was able to copy the image. Is there a way of stopping this from happening?
You're fighting for a lost cause here: You can't win. It's a bit like the classic DRM/data encryption issue: If you want to use it, you have to decrypt it. If you can decrypt it, it's no longer protected.
You can avoid users being able to hot-link images (which still can be faked/circumvented) and you can try to make it harder to download images with standard tools (like the browser's context menu), but in general you just can't avoid it, because you don't have control over the client.
What you can do - which will make downloading a bit harder without screwing with basic functionality etc. - is not using <img/> but rather a <div/> with the image set as its background-image.
But if you really care about your own images, I'd do the following rather than trying to screw with users just appreciating your work (they might want to set a nice picture as their desktop background, which might even get them to tell others about your site):
Add a small watermark to your images, like a signature line or provide only limited resolutions. You can offer higher quality/non-watermarked copies upon request (or link some printing service).
Invite people liking your pictures to download them for private, non-commercial use.
Offer them an easy way to contact you in case they want to use the images for something else.
Add social network buttons for an easy way for visitors to show their friends your work. They don't have to copy anything if they can just link the stuff the easy way - plus this will net you some more traffic for free!
There are reasons sites allowing people to share their photographs, artworks, etc. (deviantART, instagram, etc.) are so popular: People like to use them, they appreciate the involved work, etc.
And don't forget: Just because you don't "protect" your content with some nasty tricks doesn't mean you don't own the rights or aren't any longer allowed to fight others abusing it. You can still legally fight against others violating your copyright or other rights, even if you offer it for download for free (unless you give them proper permission, e.g. with some creative commons license).
I need to create a simple application that would generate reports based on database data and some user input. I have vast C/C++ experience, but for this project we had to choose C#.
I want to avoid using 3rd-party components that would require installation on a client machine as much as possible. Thus, I would like to avoid using even the features provided by MS Office (I could have used an XLS template, just like my predecessor did, but it doesn't look like a way to go; anyways, my predecessor's sources are long lost, which is probably good, since it is a roughly 10-years-old VB monstrosity that crashes every now and then). The same goes for crystal reports and whatnot.
My current idea is to build HTML tables (using an HtmlDocument) on the fly, to present them to the user (using a WebBrowser) and to print them. Is it a right way to go? Are there any simpler/more robust/better approaches? What are the possible pitfalls?
Building tables on the fly would work. I use that technique every so often, but it seems like a hack to me. I only use it because quite often, the business need requires "good enough" and quick turnaround as opposed to "beautiful".
I'm going to preference what I'm about to suggest bysaying that I have a strong bias against 3rd-party components myself.
I flat out refuse to use them in most cases and will go out of my way to come up with another solution, because I've been burned on upgrades/licensing too often.
That said...
Fortunately, with .NET not all 3rd party components need to be installed to your clients PCs. With XCOPY deployment, often you can just reference a .DLL or a project in the solution ans specify the "Copy Always" or "Copy if newer" option to just include the dll (or resulting dll if you're referencing a class library project) and as long as the .dll is present in the same directory as the executable, the 3rd party component works.
With all of that in mind, there's a project that I've used to print a DataGridView from Windows Forms at CodeProject. This is one that you can get the source for, reference it, and use it without having to actually install anything at the client. I've used it in more than one app, and it's one of my favorite tools.
It will print ONLY the DataGridView, but it prints it exactly as it appears on screen, so if that's what you want, I'd recommend at least checking it out.
As a third option, you could consider using ASP.NET. If you're going to be generating HTML, it's just as easy (easier actually) to do it using ASP.NET than in a WinForms app. Using ASP.NET you get Repeaters, ListViews, etc, all of which make the reports easy to create.
I've got more than one real-world app that is primarily a WinForms app but has an associated reporting site.
For example, I have a WinForms app used for scanning coupons accepted at our retail locaitons. It's a WInForms app because I need to interact directly with the scanner on a COM port. However, for the reporting portion, I set up an ASP.NET website. In the WinForms app it's very simple to create a reporting menu option and point to the pages. Our users generally don't even think about the fact that this is two distinct applicaitons. They see it as one - their Coupon Scanning app.
The point of all that is that it's usually possible to do things with any given tool, but it's far easier to use the tool that is meant for the job. If you're going to be generating HTML reports, ASP.NET is a better tool than building the reports manually, and if you need to have a WinForms app for most of the UI, you can still do that and use the website for the reports - using the best tool for each task.
Maybe you would like to check RazorEngine, to create your HTML templates.
I recommend you Razor engine to render html, it is more flexible than working with HtmlDocument objects.
You can create a file with your report template, and then parse it sending a Collection of your report rows objects.
An app (C#4, WinForms, Entity Framework, SQL Server 2008) of mine maintains a graph of interconnected objects, each having some simple member fields and a set of many directed (in and out) one-to-one links to other objects.
I'd like to offer a user an ability to view and edit this graph visually some way, creating and removing connections, modifying objects attributes values and introducing/dropping objects.
I suppose there has to be a framework (at list a primitive kind of) for this as visual model design tools are pretty common to meet. Do you know one?
A few years ago I collaborated with a project that used this kind of tool to build parsing software for education. The tool that was used was Graphviz, in special dot and dotty. If you don't know what is it, then this is a short description about it:
Graphviz is open source graph
visualization software. It has several
main graph layout programs.
The Graphviz layout programs take
descriptions of graphs in a simple
text language, and make diagrams in
several useful formats such as images
and SVG for web pages, Postscript for
inclusion in PDF or other documents;
or display in an interactive graph
browser. (Graphviz also supports GXL,
an XML dialect.)
Graphviz has many useful features for
concrete diagrams, such as options for
colors, fonts, tabular node layouts,
line styles, hyperlinks, and custom
shapes.
This is an example of the kind of graphs that were built:
(source: ucse.edu.ar)
You should note that this is not a native .NET tool, but of course, you can use it anyway.
This answer might come a little late, but Microsoft has its own .Net library called Microsoft Automated Graph Layout (MSAGL) which looks (at least visually) suspiciously similar to GraphViz, or, DOT in particular. Its name has changed over time as it has been developed in MS Labs/MS Research.
According to the product page, it contains three modules:
Graphing module Microsoft.MSAGL.dll,
Drawing module Microsoft.MSAGL.Drawing.dll, and
Viewer control Microsoft.MSAGL.GraphViewerGDIGraph.dll that seems to be a Windows Forms custom control.
This software used to be free a long time ago, but, unfortunately, it has made it into a paid product.
I would like to have two streams. One being traditional streaming video and another being text. I will also build an interface that allows the user to create the text portion while watching the video. The context of these videos are usually that of an individual being filmed doing a presentation and later the next day for example, a coach will make text annotations (structured data is a plus) with the result being the text stream.
It seems this is possible with Silverlight (see the article in the latest MSDN). However, what other methods are there if any? If there any, please give the reasons for why you are recommending them. Thanks.
Also, I would prefer something that inst a software as a service hosted solution, but, dont let that keep you from giving an answer. Also keep in mind, the user shouldn't have to do any re-encoding of the video source, the text stream should be separate with someway to synchronize a coach's comments to an arbitrary time stamp in the video.
http://slvideoplayer.codeplex.com/ This project has good support to show markers based on video time-line. It is currently built using SL2 but you can upgrade this to SL3 easily.