Draw image from swf with C# graphic - c#

I have swf file's that's contains 2D images (here one of them: http://mapviewer.ru/img/tramvay/depo_d.swf )
I need draw this image (like seen in my browser), to bitmap.
Maybe i need convert this file to image (png, jpg)? No matter how, but it should be done programmatically.
Updated

Have you tried to look at this library ?

There are no embedded images inside the SWF file, only Vector shapes, which means you would need to both parse the SWF and render the data that is inside, so taking a screenshot of it is probably your best option. There are a lot of ways of doing this, but you could simply load the Flash Active-x in your application and take a screenshot. Here's how to load the SWF : Displaying Flash content in a C# WinForms application

Related

A way to save System.Windows.Forms.DataVisualization.Charting chart image as .svg or other vector image

I am using System.Windows.Forms.DataVisualization.Charting chart control to render graphs for some data in my c# winforms application. I now need to save those graphs/charts as .svg or any other lossless vector image, so that it can be seemlessly scaled when used in report.pdf.
Any suggestions are welcome.
I have looked into SaveImage(String, ChartImageFormat), where ChartImageFormat is an enum that does not include any vector image formats. Also searched stackoverflow and similar repos for an answer and as far as I see this is actually a duplicate question (Save ms chart control image as svg file using C# SVG rendering library from github), but the guy quit and used oxyplot instead.
chart.AntiAliasing = AntiAliasingStyles.All;
string imageNameAndPath = "TempImages/Image.png";
chart.SaveImage(imageNameAndPath, ChartImageFormat.Png);
In short I would like to do what the above code does but with ChartImageFormat.SVG or similar.
Edit: #TaW It seems now to me that I was not able to formulate the question correctly. To elaborate: Pictured here are two plots;
the violet one is from mentioned win forms, the white one is from oxyplot. Both get saved into files; the first one to emf the second one to svg file. Bit when those files are opened and zoomed in this is what I get:
So now I am not sure from where this quality difference originates, but it is obvious. So I guess my question is: how would it be possible to save a chart in windows forms in a vector format of a similar quality as it is the one from Oxyplot, preferably without actually drawing on screen (somehow drawing directly to a file, so to speak)?

Svg files to display in Android

I have a large number of svg files (over 1000) that have keyframe animations included in the CSS. Ultimately I want to be able to display these in an android app.
I looked into using android vectordrawable among other solutions but that will only display the image from path data and wont be feasible to try add animations to every file.
I have have also tried converting to png using http://www.codeplex.com/svg in c#, again the png file does not include the animation.
You can use a Webview to display your svg.
here is a post that can help .svg file as object in HTML

Display SVG in UWP app image control, desktop and phone

Is there a way to display an SVG image (from a URL) in a xaml Image control in a UWP app
e.g.
<Image Source={Binding image_source}>
Where image_source is an absolute path to an image. Where the image is either png or svg format.
My solution works as expected with any common graphics format (jpg, png, gif) but displays nothing when the graphic is svg format.
I've seen loads of articles about converting the svg to something else, but the information comes from a web service that is not mine and use by others I would suspect. changing images on mass to png or something else I doubt would be an option.
In my application the Image is within a listView.
I've seen articles about converters and built in support for svg but none of them seem to work. I have yet to find any article here or anywhere with someone that has a working solution other than manually converting files (not an option)
Any help would be much appreciated.
UWP supports SVG natively and your solution should work. I guess the issue in your case is due to scaling. Make sure your graphics image has not scaled out of boundaries and you only see transparent part of it. You might try testing other SVG files to confirm that and play with size and SVG ViewBox attribute.

best way to display images android?

I am developing an android application and I have to display images in it. This image is uploaded from a c# application and I need to retrieve it to android client.
I am trying by loading the image into the DataBase and retrieveing it from android, but this takes much memory and I need a better way to do it.
This c# application is allocated into the server so maybe a good way is to store the images and access to the path from the android client, but is it possible to public an image in my server?
Further, which one you think is the best way to do it?
Thank you.
If I understand you correctly: You upload a picture using a C# program which stores the image (as binary data) in the database?
I would recommend to store the image on the filesystem and the (relative) path to the image in the database. Your Android clients get the URL of the picture and can download and display the image.
There are (very good) Android libraries for displaying images from URLs. Take a look at this library: Android-Universal-Image-Loader.
I will recommend you to store image file to server, and add its path to database.
The easiest ways to display image in your android app is using Picasso Library.
Download Picasso library from here
Add it to your build path. Import this library to your code file.
For loading image from web url:
String url = "http://example.com/image.png"
Picasso.with(getApplicationContext()).load(url).into(imageView);
For loading image from drawable:
Picasso.with(getApplicationContext()).load(R.drawable.imageFile).into(imageView);
Here, imageView is the name of variable you are using to represent ImageView. Eg.
ImageView imageView = (ImageView) findViewById(R.id.ImageView1);
To use Picasso with ImageButton, change imageView variable to imageButton variable
ImageButton imageButton = (ImageButton)findViewById(R.id.imageButton);

Create an .avi file from a list of bitmap images

I am currently trying to make a screen recorder.
I made list of bitmap images and want to put them in an .avi file.
Is there anyway to do that in C#?
note: i'm a novice, so keep things simple
Try SharpAvi library. Its sources include a sample screen recording application.
Try this site which has downloadable examples as well: A Simple C# Wrapper for the AviFile Library.

Categories

Resources