.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

Resize animated gif

Posted By:      Posted Date: October 17, 2010    Points: 0   Category :ASP.Net
 

Hello

I need to resize animated gif files in my asp.net 4 Web site. Is there any libraries i can put in my Bin folder that just works without an ocean of configuration? It can not be any program i must install on the computer/server to use because my host doesnt do that stuff i think.




View Complete Post


More Related Resource Links

resize png at time of uploding without loosing tranparancy of img

  

 

i have tryed so many code to resize n compress png img but after resize it loose it's tranparancy ,

any one have good code to fix this problem.



Bad quality after resize jpeg

  

Hi,

I wrote code that resize my photo to thumbnail (100x100px). The thumbnail is ok (is blur) on serwer (Windows Serwer 2008 x64) and the thumbnail is very bad (no blur and pixels are big) on serwer (Windows Serwer 2008 x86). Both serwers have framework .net 4.0.

I wrote code on VS 2010.

Below is my code:

public static void MakeThumbnail(string path, string prefix, string filename, Stream stream, string mime, int fixedWidth, int fixedHeight, bool allowCrop)
{
string newFullname = path + "\\" + prefix + filename;

//oryginalny obrazek
Image sourceOriginalImage = Image.FromStream(stream);

int width = sourceOriginalImage.Width;
int height = sourceOriginalImage.Height;

double widthD = Convert.ToDouble(width);
double heightD = Convert.ToDouble(height);
double fixedWidthD = Convert.ToDouble(fixedWidth);
double fixedHeightD = Convert.ToDouble(fixedHeight);

int newWidth = 0;
int newHeight = 0;

int cropX = 0;
int cropY = 0;

newWidth = fixedWidth;
newHeight = (int)(fixedWidthD / Xp);
cropY = Convert.ToInt32((newHeight -

Problem with Resize on x64/x86

  

Hi,

I wrote code that resize my photo to thumbnail (100x100px). The thumbnail is ok (is blur) on serwer (Windows Serwer 2008 x64) and the thumbnail is very bad (no blur and pixels are big) on serwer (Windows Serwer 2008 x86). Both serwers have framework .net 4.0.

I wrote code on VS 2010.

Below is my code:


public static void MakeThumbnail(string path, string prefix, string filename, Stream stream, string mime, int fixedWidth, int fixedHeight, bool allowCrop)
{
string newFullname = path + "\\" + prefix + filename;

//oryginalny obrazek
Image sourceOriginalImage = Image.FromStream(stream);

int width = sourceOriginalImage.Width;
int height = sourceOriginalImage.Height;

double widthD = Convert.ToDouble(width);
double heightD = Convert.ToDouble(height);
double fixedWidthD = Convert.ToDouble(fixedWidth);
double fixedHeightD = Convert.ToDouble(fixedHeight);

int newWidth = 0;
int newHeight = 0;

int cropX = 0;
int cropY = 0;

newWidth = fixedWidth;
newHeight = (int)(fixedWidthD / Xp);
cropY = Convert.T

Easy image processing(grayscale, sepia, negative, resize, brightness, contrast and opacity)

  
Howdie y'all,

I see a lot of questions in this forum about resizing images. Recently I created a code sample(with downloadable webapp), right here.

The class (downloaded or created) allows for very fast and easy processing of your images. And a lot of problems over here can be solved by simply using that class. I thought it might help to mention the code sample in this forum as well.

Cheers,

Wes

How to make expanding/collapsing CollapsiblePanelExtender from code behind smooth and animated

  

I've got a CollapsiblePanelExtender in place on a panel in test and it works like a champ. (I get excited about the simplest things).  When I click the panel header it expands and collapses with smooth animation, as expected and desired.

But when I change its state via code behind, it seems I am merely changing its state and somehow bypassing the javascript that controls the smooth animation.

My markup is out of the box. I have added code behind and some javascript, but I am missing the connection.  Here is the javascript:

function pageLoad(sender, args)
{
    smoothAnimation();
}

function smoothAnimation()
{
    var collPanel = $find("CollapsiblePanelExtender1");
    collPanel._animation._fps = 45;
    collPanel._animation._duration = 0.50;
}

 

And here is the code behind:

protected void btnExpand_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = false;
    this.CollapsiblePanelExtender1.ClientState = "false";
}
 

protected void btnCollapse_Click(object sender, EventArgs e)
{
    this.CollapsiblePanelExtender1.Collapsed = true;
   

ModalPopupExtender animated gif not animating

  

Hi, I'm trying to use the modalPopup extender to show a "processing" message with an animated gif.  Everything works pretty well except that any animated gif I place in the modalextender doesn't animate.  Anyone know of this problem and a solution?

 

html for the popup div:

<div align="center" style="margin-top: 13px; vertical-align: middle; display: none"

class="modalPopup" id="modalPanel" runat="server">

<table border="0"

How to resize iframe when content loads..

  
I have an iframe on website A which receives the controls from website B once the form is processed on website B. Here is the page on website A with the iframe. I have hard coded the height at 100px:<iframe id="hdnFrm" name="hdnFrm" src="" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="width:90%;height:100px"></iframe> <form action='http://www.link-exchangers.com/adv_links_addber.aspx' target='hdnFrm' method='post' name='form1'> <table width=90% align=center cellpadding=2 cellspacing=0 border=0> <tr><td valign=top>Contact email: </td><td><input type=text name=web_email value="<?=$web_email;?>" style='width:250px'></td></tr> <tr><td valign=top>Reciprocal link: </td><td><input id=web_recip type=text name=web_recip value="<?=$web_recip;?>" style='width:250px'></td></tr> <tr><td colspan=2 align=center><input type=submit value="Save" style='width:100px'></td></tr> </table></form> Once the Save button is clicked, website B processes the data in this form, and sends messages and a

How do i resize teh status bar items?

  
hi friends, i have the following status bar and i have added a color scheme so the it's clear what im asking of:     here what i want: 1. How do i set the statusstrip item colored in black to change it's length when teh form resizes and and i want all the other statusstrip items to have fixed size (that doesnt change) when form resizes? 2. How do i set the status strip item colored with pink and blue to fixed length but all others changes its lenght when form resizes? thanks

Converting to stream after resize for SQL Insert

  
Hey guys,I'm running with this. Public Function ImageData(ByVal fu As FileUpload) As Byte() If fu.HasFile Then Dim imageBytes As Byte() = New Byte(fu.PostedFile.InputStream.Length) {} fu.PostedFile.InputStream.Read(imageBytes, 0, imageBytes.Length) Return imageBytes Else Return Nothing End If End Function Public Function ImageResize(ByVal fu As FileUpload) As Bitmap Dim thumbWidth As Integer = 1024 Dim image As System.Drawing.Image = image.FromStream(fu.PostedFile.InputStream) 'Create a System.Drawing.Bitmap with the desired width and height of the thumbnail. Dim srcWidth As Integer = image.Width Dim srcHeight As Integer = image.Height Dim thumbHeight As Integer = (srcHeight / srcWidth) * thumbWidth Dim bmp As New Bitmap(thumbWidth, thumbHeight) 'Create a System.Drawing.Graphics object from the Bitmap which we will use to draw the high quality scaled image Dim gr As Graphics = Graphics.FromImage(bmp) 'Set the System.Drawing.Graphics object property SmoothingMode to HighQuality gr.SmoothingMode = Drawing2D.SmoothingMode.HighQuality 'Set the System.Drawing.Graphics object property CompositingQuality to HighQuality gr.CompositingQuality = Drawing2D.CompositingQuality.HighQu

Trying to make a workaround for animated GIF in WPF

  
Hello. I'm trying to make a workaround for displaying, with (semi-)correct delays, an animate gif with partial frames into an Image control from a ReadOnlyCollection<BitmapFrame> (from BitmapDecoder) What I've done so far was load the same file as a System.Drawing.Image, get the delays using GetPropertyItem(0x5100), and trying to recompose the frames. The whole thing runs on a separate Task, which then calls another Task with a TaskScheduler.FromCurrentSynchronizationContext() to update the UI. Here's the relevant code as of posting:         private void AnimateTaskMethod(ReadOnlyCollection<BitmapFrame> bi, CancellationToken ct) { int count = bi.Count; int[] delay = new int[count]; int i = 0; System.Drawing.Image img = null; try { img = System.Drawing.Image.FromFile(FileList[(int)index]); System.Drawing.Imaging.PropertyItem prop = img.GetPropertyItem(0x5100); for (int x = 0; x < count; x++) { delay[x] = 10 * BitConverter.ToInt32(prop.Value, x * 4); if (delay[x] == 0) delay[x] = 100; } } catch { for (int x = 0; x < count; x++) { delay[x] = 1000; } } finally { if (img != null) img.Dispose(); } while (true) { ct.ThrowIfCancellationRequested(); Thread.Sleep(delay[i]); Task UIAnim

Animated Gif that does not animate.

  
I have two animated gifs that display nicely. I put them in a div with style="display:none". When the user submits the form will display the div with animated gifs. I use Jquery to display my dialog. The animated gifs and text will display fine, but my animated gifs does not animated when I do a form submit. What I am doing wrong? 

Resize image

  
Hello, am writing code for upload image file and save it into disc ,,, during this and before save it to disc I want to resize the image into specified width and Heigh  am trying to use this code if (this.IsValid && this.FileUpload1.HasFile) { //Create an ImageElement to wrap up the uploaded image Neodynamic.WebControls.ImageDraw.ImageElement uploadedImage; uploadedImage = Neodynamic.WebControls.ImageDraw.ImageElement.FromBinary(this.FileUpload1.FileBytes); //Create Resize imaging action to apply on the uploaded image //NOTE: You may apply any of the ImageDraw built-in imaging actions Neodynamic.WebControls.ImageDraw.Resize actResize = new Neodynamic.WebControls.ImageDraw.Resize(); actResize.Width = 150; actResize.LockAspectRatio = Neodynamic.WebControls.ImageDraw.LockAspectRatio.WidthBased; uploadedImage.Actions.Add(actResize); //Composite the output image by using ImageDraw class Neodynamic.WebControls.ImageDraw.ImageDraw imgDraw = new Neodynamic.WebControls.ImageDraw.ImageDraw(); //Add uploaded image imgDraw.Elements.Add(uploadedImage); //Now, save the output image on disk string fileName = @"../images/" + System.IO

image resize according to user options

  
i want to provide user to select images to upload, maximum images is 4.the overall size is 1024px width and 500px height.within this 4 or 3 or 2 images will have to fit.if the user upload 4 images it has to calculate the overall width and height and resize the 4 images as equal width and height for each.if the user upload 2 images it has to calculate the overall width & height and fits.i want to do through code. iam using c# asp.netif any samples plz provide me.

Why don't the row details of this DataGrid resize properly?

  
I have a DataGrid with a Grid in the row details and I am seeing somethign weird - if one of the columns' width is "*", the row details pane does not resize properly when resizing the window, namely, the pane resizes when the window size increases, but it does not shrink when the windows size shrinks. Does anybody have any idea what is going on? Here is a greatly simplified XAML that still exhibits the behavior (the code behind simply loads an XML file to supply the data): <Window x:Class="Test.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:xlinq="clr-namespace:System.Xml.Linq;assembly=System.Xml.Linq" Title="Test" Height="500" Width="800" Closing="MainWindow_Closing"> <DockPanel Name="dockPanel1"> <DataGrid AutoGenerateColumns="False" HeadersVisibility="Column" IsReadOnly="False" DataContext="{Binding Path=Doc.Elements[one]}" ItemsSource="{Binding}" RowDetailsVisibilityMode="VisibleWhenSelected" > <DataGrid.Columns> <DataGridTextColumn Header="Name" /> <DataGridTextColumn Header="Value" Width="*" /> </DataGrid.Columns&g

How do I display my animated image while the next page loads?

  
I have the following code so it'll show an animated progress GIF but if the site takes longer than this, it will quit. Is there a more effective way?System.Threading.Thread.Sleep(2000) Here's my update progress code:<asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> <div class="PleaseWait"> Please wait ... </div> </ProgressTemplate> </asp:UpdateProgress>  

Undo After Adding Activity Which Causes Designer Resize

  
Hi, I created a very simple test application which consists of a Toolbox and a Workflow Designer.  In the toolbox, I only added a "Terminate" activity: public MainWindow() { InitializeComponent(); new System.Activities.Core.Presentation.DesignerMetadata().Register(); _workflowDesigner = new WorkflowDesigner(); Grid.SetColumn(_workflowDesigner.View, 1); _workflowDesigner.Load(new System.Activities.Statements.Flowchart()); LayoutGrid.Children.Add(_workflowDesigner.View); _toolbox = new ToolboxControl(); ToolboxCategory undoTestCategory= new ToolboxCategory("Undo Test"); ToolboxItemWrapper terminateTool = new ToolboxItemWrapper(typeof(System.Activities.Statements.TerminateWorkflow), "Terminate"); undoTestCategory.Add(terminateTool); _toolbox.Categories.Add(undoTestCategory); Grid.SetColumn(_toolbox, 0); LayoutGrid.Children.Add(_toolbox); } When I drag/drop the "Terminate" to the middle of the designer, I can press Ctrl-Z once to undo it (i.e. remove it from the designer).  However, if I drop it at the edge of the designer which forces a resize/expansion of the designer, it takes 4 Ctrl-Zs to undo it.  Is there a way around this?  Also, is there an easy way in the debugger to see the undo stack? Thank you.  
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend