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

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

Auto-generating Name When Saving an Image

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
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.

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.

Auto saving the Winform application

hi,   I am developing a huge win form application, which has lot of win forms, user controls and wizards. For user it will take some time to fill-in all the fields and complete the wizard. I wanted to implement auto saving the application for every 3-4 minutes, this should be done in the background without disturbing the user activity (or thread)..   can anyone help me to implement this? Please share your 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....   

Generating for each data in Database new Image

Hello everybody! I have the next problem. I have in Database about 100 rows with X and Y coordinates. I have the one image -> "Car.png" How can I in one statement show all 100 cars in my Wpf Application ? ( generate for about 100 Image objects ). Best Regards, Oleg

Receiving error when saving site as template: [InvalidOperationException: Error generating solution

I am getting the following error when saving a site as a template (just this specific site is having this issue - other sites in collection successfully save as template): [InvalidOperationException: Error generating solution files in temporary directory.] Microsoft.SharePoint.SPSolutionExporter.ExportWebAsSolution() +26053165 Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent, String workflowTemplateName, String destinationListUrl) +1778 Microsoft.SharePoint.SPSolutionExporter.ExportWebToGallery(SPWeb web, String solutionFileName, String title, String description, ExportMode exportMode, Boolean includeContent) +44 Microsoft.SharePoint.ApplicationPages.SaveAsTemplatePage.BtnSaveAsTemplate_Click(Object sender, EventArgs e) +331 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981 I'm thinking it may have something to do with permissions, but other sites can save as a template. Also, it does not specify

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

Dynamically generating of hot spots on image


HI all,
           I am facing problem with the dynalically generating the image at particular with coordinate points on image map through code behind (aspx.cs).
    As per my requirement i need to generate Hotspots dynamically and also displaying an image to indicate the Hot spots.
Please send me the code above that ...

thanks in advance

Auto resize image width only


I have a question regarding the resizing of images.

My problem is that I would like to resize files that are being uploaded automatically. But I only want to resize the width.

Regarding the height of the file, this should auto adjust it self. Forexample; If I'm uploading a file that is 1000 px in width and 2000px in height and then resize it to 500px in width, then I want the height to be auto resized to 1000px. In other words the height and width has to be proportional. 

Could someone help me out on this. 

Thanks for reading. 

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


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.


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!

Auto populated 'New item form' not saving to sql

Hi, I have created a 'New item form' for a sql datasource via Sharepoint Designer. A lot of the fields are pre-populated using parameters pulled from a wedpart on the same aspx page. I have assigned the parameter to the field by setting the 'text' value to equal the parameter e.g. text="{$p3address3}". If I manually type values into the form (with no pre-populated at all) the data saves perfectly into the sql table but if I submit the form when I have pre-populated the fields then no data saves at all. Am I missing something? Is there a different way to set the values for my fields? Thanks Jeni

Securely Saving Windows Auto Logon Password in .NET


I'm trying to securely store a password for autologon in Windows through .NET.  There are lots of examples out there about how to securely store the password in C++ or about how to *insecurely* store the password in .NET.  But I can't find any examples that do it securely in .NET.

Here's the article that explains how to do this insecurely:

And in it there's a link to how to do it securely using C++:

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<

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