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

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Saving asp panel or div as image in asp.net/c#

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

Hi Folks, 

  I am having a requirement and i believe most of you  have already did it. This is the problem, i am having a div with image controls and i want to save it as image[png or jpeg] in database on button click. I have googled a lot but couldn't find a good start.  

<div id="frame" title="xxx" class="resize" style="width:634px; height:410px; overflow:hidden;">
<img id="drag56800" runat="server" src="Images/circle_street.png" style="height:140px;width:140px;border-width:0px;left:773px;top:123px;position:fixed;" /><img id="drag54101" runat="server" src="Images/animals/horse.png" style="height:30px;width:30px;border-width:0px;left:800px;top:171px;position:fixed;" />
Any code ,suggestion or aricle will help me.


View Complete Post

More Related Resource Links

image.save not saving images


I have a piece of code that writes string into an image and save it. It works on one of my site and but not the other. The image.save is not working. If this is a permission problem, which account should I change? I use win server 2003 and IIS 6, and have given ASPNET, NETWORK SERVICE, and anonymous user write access.

An image on the bottom of a panel

Hi, In my .net web page, I have an image which I want to put it in a particular panel's bottom, regardless that panel's size shrinking or growing.How do I do that?Thanks for help. Jason  

Copy non-visible area of a panel to image object?

Hello, I'm using VS2008 and I would like to copy the entire area of a panel to an image object (bitmap image).  There are lots of examples out there describing how to copy certain areas of the screen, but I would like to capture the entire area of a panel, even if a portion of the panel is not currently visible. Or perhaps you can suggest a different way to achieve my goal - that is, I have a table layout panel with some various lineshapes drawn onto it, and I am aiming to recreate or simply include it on a rdlc report as an image.  Because of the various lineshapes that are included in the tablelayoutpanel, a datagrid/table/matrix control doesn't appear to be an option.  So I'm aiming to copy the tablelayoutpanel to a bitmap image object, then insert that into an image control on the report.  Any ideas? Thanks!

Saving Image File in a Folder on Sever from Client Machine using Sql Server

  Hi EveryOne... Can anyone help me Saving an Image file in a Server folder from a client machine using Sql server 2005....   

Using AJAX update panel to show image but still blinking

May anyone help me on this issue please?I'm developing a web site that can grab image captured from cameras and show in the web page, i'm currently using Ajax's Update panel to update the image every second, my web files and Images is located in IIS virtual directory, browsing using IE7.My code is as following :<asp:UpdatePanel ID="uPVideoPane1" runat="server">                                 <triggers>                                     <asp:AsyncPostBackTrigger ControlID="Timer" EventName="Tick" />                                 </triggers>                                 <contenttemplate>                                     <asp:LinkButton ID="linkCamera1" runat="server">                                         <asp:Image ID

How to make background-image of table or panel Rounded ?

Hi, I have taken background-image of a Table and Panel, that image's corner is rectangula. How can i make its corners Rounded ? I searched some online resources, images were made rounded, how to make make background-image rounded on the fly ? 

saving image in databse

how to store image files in sqlserver database i am using datatype  image  and also i tried with varbinary .but while placing image file as pc.jpg it showing   error

Auto-generating Name When Saving an Image

hi guys, I have a toolbar on my chart:  <Toolbar Enabled="True"> <Items> <dcwc:CommandUIItem CommandName="PrintPreview" /> <dcwc:CommandUIItem CommandName="Print" /> <dcwc:CommandUIItem CommandName="Separator"/> <dcwc:CommandUIItem CommandName="SaveImage" /> <dcwc:CommandUIItem CommandName="Separator" /> <dcwc:CommandUIItem CommandName="UserDefined_1" /> </Items> </Toolbar>     For the SaveImage, I want to be able to set my image name with its own name. the name can be found using:   string fileName = Request.PhysicalApplicationPath + @"graphs\"+User.Identity.Name+graphID+".jpg"; Right now, when I click save, it always show chart.png And also, I want to download the chart as jpg.   thanks guys.

C# Tutorial - Image Editing: Saving, Cropping, and Resizing

In C# it can be tiresome to do certain image editing functions using GDI+. This post has some fun editing methods which can come in handy at times. I have also included a nice little C# program to show all the functionality of the methods below.

Saving a Jpeg
The first thing to do here is set up the method signature with the input parameters. These are the save file path (string), the Image to save (System.Drawing.Bitmap), and a quality setting (long).

Drawing and saving a vector image (emf/wmf or anything MSWord/PPT can read)


Hi! I've been tasked with generating graphs of data as images for the purpose of importing into MS Word documents and Powerpoint presentations.

I've done it using GIF images, but I'd really like to use a vector format, so they can be scaled in the document without losing quality, and of course keeping the document size down as there's lots of them.

MS Word and Powerpoint can import EMF, WMF and CGM formats, but I have no idea how to generate those in .NET.

Does anyone have some pointers for me to get started creating say EMF files from .NET?  I've looked all over the net and can't find much at all about it... I've gathered it's a job for GDI+, but can't find sample code or anything for .NET.

Many thanks!

Capturing Signature on touch screen handheld device and saving the Signature Image as .jpg or .gif o


Hii every one

Iam in a requirement of capturing Signature on touch screen hand held device and saving the Signature Image as an .jpg or .bmp or .gif on the device.
Could someone give code for the above requirement.

Resize image and get new byte size without saving it


Hi Guys,

I'm making an application that needs to be able to take a user specified image file and upload it into a database that only accepts images of 10 KB or less. So I want to let the user select an image and then have the option of resizing it and if possible also decreasing the quality - I'm sure I can figure out how to do both of these things on my own but the thing I'm not sure about is how I can tell what size the resulting image will be without actually writing it to disk. I thought the SourceStream property of the BitmapSource class would be useful but when I try to access it I just get told that the stream has been closed. Any ideas?




My website: www.cjwdev.co.uk My blog: cjwdev.wordpress.com

Saving Gray8 with BmpBitmapEncoder results in 256 color palette and 16 color image. Why?


Saving a Gray8 image using the BmpBitmapEncoder doesn't give an error, but does multilate the image.  The header and color table are those of an Indexed8 gray scale image, but the pixels have only 16 possible values 00, 11, 22, ..., DD, EE, FF.  Is this by design?  A FormatConvertedBitmap from Gray8 to Indexed8 and saved using the BmpBitmapEncoder results in the correct image.  This code demonstrates:

    Dim R As New Int32Rect(0, 0, 1024, 768)
Dim B(R.Height - 1, R.Width - 1) As Byte
    For Y As Integer = 0 To R.Height - 1
For X 

saving WPF inkCanvas to image makes black background



i am saving inkcanvas but it saves black image




rtb = new RenderTargetBitmap<

Radio buttons, a label and an image button show twice inside update panel


I have an update panel with a set of 2 radio buttons, a label and an image button inside of it. There another set of 3 radio buttons that trigger the update panel. I got everything working but now the image button, label and set of 2 radio buttons inside the update panel show up twice when the radio button triggers are selected? Any ideas?

Built-in Functions - Text and Image Functions in SQL Server

Text and image functions operate on TEXT, NTEXT and IMAGE data types. These data types are deprecated with SQL Server 2005 and should be replaced by VARCHAR(MAX), NVARCHAR(MAX) and VARBINARY(MAX) when possible. Alternatively you can also consider storing large string values using XML data type. Text and image functions are nondeterministic.

Future versions of SQL Server will not support TEXT, NTEXT and IMAGE data types. Columns with TEXT / NTEXT data type do not support commonly used string functions such as LEN, LEFT, RIGHT, etc. Furthermore, due to the large size of TEXT data you''re likely to see performance issues if you store such data in the database. However, at times you can''t help but use the TEXT / NTEXT / IMAGE data types (for example when supporting 3rd party databases when you cannot change the schema) - this is when text and image functions come in handy.

Program for Format Conversion of An Image

.NET provides extensive support for image conversion. Any image can be processed from one format to another. Most common formats to which .NET have support for are .BMP, .EMF, .GIF, .ICO, .JPG, .PNG, .TIF and .WMF.
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