I have a grid in my application where I show thumbnail (100*100) of images. I am using imageresizing.net plugin to generate thumbnails on the fly. My image URLS are coming from third party application. Sometimes instead of images I am getting a flash file (.SWF). The plugin is throwing ImageCorruptedException.
As of now, I am handling the exception in Application_Error of Global.asax and returning back a default image URL.
Now I want to show the thumbnail of flash image instead of default image. How can I achieve this in C#? I have searched a lot on Google but no convincing answers.
Related
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
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);
In my application, I post articles and the entire document is stored as html in the database. In different places in the articles I use images. (By uploading it or just placing img urls).
On the homepage I want to make thumbnails of my desired size, so that I can place some recent articles along with their preview images there.
So, how can I extract larger images from any html document? (So that only relevant images are selected, not any other images)
And from the list of images, how to determine and select image which occurred at first?
I want to use that "one" image to make thumbnail programatically on the server. I
will cache it and then display it on the page.
Like a wordpress application or any other CMS does.
Currently, I use the following approach which is I think is not correct:
At the time of posting an article when I upload images in the editor, I keep the imageId of the of the last uploaded image and store it into the database along with the article. So I have a separate column for imageId for each article I post.
Problem starts when I do not upload any image, then I have to insert a default imageId automatically to avoid problems. This process is annoying. Please help me out. Please guide me the most practiced and the easiest solution available.
The site where I implement all this is http://disneyduniya.in
You can use demo of below code: Generate Web Page Thumbnail Screenshot Image:
Demo link Its working : http://pietschsoft.com/post/2008/07/C-Generate-WebPage-Thumbmail-Screenshot-Image
It will create image file ,save this file As and customize height and width
.
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
I'm using the control FileUpload to choose an image and upload but now I want to display a preview of the chosen image before saving the image, just to give the user an output of the chosen image.
I googled but could not find an answer for that.
The problem is you have to upload the image to your server to you can display(serve) it.
I did some searching, and found this question: How to show local picture in web page? - and I was thinking, if you have the local path of the image, why not use some ajax to pop the url in a simple img tag.
However, you can't even link to a local image anymore, due to security. So for your application to show a preview of the image you would have to first have the image to display it, and the upload would have to occur first.