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


Post New Web Links

Refresh Cached image

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :WPF
 
Hello! I have an Image that is cached because I want to be able to change the file on runtime without getting exception about the file being in use. This works fine, but how can I programatically force a refresh of the image from file. I have a function that replace the file, so it would be nice to have a refresh function.  Is this possible?   <Image Name="imageThatIWouldLikeToRefreshFromCode"> <Image.Source> <BitmapImage UriSource="C:\image.jpg" CacheOption="OnLoad" /> </Image.Source> </Image>


View Complete Post


More Related Resource Links

how to refresh image updated with AsyncFileUpload

  

I've created an AsyncFileUpload device that uploads an image in ListView but it doesn't refresh on the page until the page is manually refreshed. Any ideas on how to accomplish this? This is the applicable code:

In ListView control:

<asp:UpdatePanel ID="udpPhoto" runat="server">
    <ContentTemplate>
        <span style="text-align: center; vertical-align: middle; font-size: 7pt;">
            <br />
            <asp:Button ID="btnEPhoto" Font-Bold="False" TabIndex="160" Text="Upload/Change Photo"
                UseSubmitBehavior="False" OnClick="btnPhoto_Click" runat="server" />
            <br />
            <asp:Label ID="lblEPhoto" runat="server" Font-Bold="True" Text="Uploaded Photo:" />
            <br />
            <asp:HyperLink ID="lnkEPhoto" runat="server" BorderWidth="2px" NavigateUrl='<%# Eval("Photo_Recent") %>'
                Target="_blank">
                <asp:Image runat="server" ImageUrl='<%# Eval("Photo_Recent") %>' Height="50px" ID="imgEPhoto">
                </asp:Image>
      

Refresh an image with jquery

  
Hi,how can I refresh an image with below script.This  url returns '/CAPTCHAImage' an gif. I can get image with this but I can't set the gif to img.How can I do this?Kind regards.$.get('/CAPTCHAImage', function(data) { $("#guvenlikKodu").attr("src",data);});

Image Refresh problem

  
Hi

Im quite new to WPF and I'm stuck with an refresh issue.
The scene is as follows:

1) I have a form with an image on it.
2) A screenshot is made, and saved to the above mentioned image. (from the app)
3) The image should be refreshed to show the new image (but same file)

However I can not get it to work.
I can see the file is changing on the disk (viewing it and timestamp) and even in the WPF designer the image changes, but not in the running app :-/

I don't know what wrong. (other than the image does not refresh). So can anyone help?
My code is as follows:

XAML:

<Window x:Class="Imagetest.Window1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title

can't refresh image in ModalPopup

  

I have a page where the following code works to refresh an updated image, but it won't work in another page. (The Util.FindChild is an enhanced FindControl that I use.) I'm sure it has to do with the ModalPopupExtender not closing but I don't know what to do about it. I also use a ModalPopupExtender on the other page and it works--in fact, both are virtually identical since they both originate from the same user control. Any ideas?

'these three statements could be cleaner but at present 
'they come from a number of controls in different templates
Dim img As WebControls.Image = DirectCast(Util.FindChild(Me, "imgUploaded"), WebControls.Image)
If img Is Nothing Then img = DirectCast(Util.FindChild(Me, "imgUploadedE"), System.Web.UI.WebControls.Image)
If img Is Nothing Then img = DirectCast(Util.FindChild(Me, "imgUploadedT"), System.Web.UI.WebControls.Image)
If img IsNot Nothing Then
   ScriptManager.RegisterClientScriptBlock(Me, _
      GetType(Page), _
      "imageRefresh", _
      "window.parent.document.getElementById('" _
      + img.ClientID + "').src='" + strFile + "?t=" + _
      (New Random().Next(9999)).ToString() + "';", _
      True)
End If




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.

Configuring Profile Image Export in SharePoint 2010

  
It's no secret that I am thrilled with the new social features of SharePoint 2010. I am most excited about the new Profile Picture handling. I strongly believe that the more we can show the faces of our colleagues to one another the more connected we will feel. Clearly Microsoft feels that way as witnessed by the many features that make use of the Profile Image like the Activity Feed and Colleagues list

Built-in Functions - Text and Image Functions

  
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.

ASP.Net Upload Image to MS Access Database

  
As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

  
n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:

slideshow image gallary using jQuery

  

Hi,

i need a gallary like following link.

http://www.leigeber.com/2008/05/ajax-image-gallery-slideshow/

actually,i bound multiple image in a gridview using handler(.ashx).

for example,in one dep_id(1),there are 6 image and i need to slideing one by one.

could some one help me,how i can do like this?

i think is it easy in jquery.

please someone help me.

Thanking you.




datalist image slide show problem

  

hi friends


i am binding  images dynamically(back end)for a datalist .iam applying a slideshow for it .I am getting a problem to apply slideshow for dyanmically binded images.If the define in a div statically it working perfectly

for example pls go through my code below:

<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'scrollLeft' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
    });
});

<div class="slideshow">
        <img src="images/30_dummy.jpg" width="200" height="200" />
        <img src="images/aquarius.gif" width="200" height="200" />
        <img src="images/star.gif" width="200" height="200" />
        
        <img src="images/the-proud-indian-flag-1.jpg" width="200" height="200" />
    </div>


I above code works perfectly and the slide show e

Can't display an image from the database

  

 Hi,

My database has a products table that has images stored in a varbinary(MAX) column.

I'm trying to display product information in a repeater and trying to display the images as well by using a GenericHandler class but I can't get the image to show up in my page.

Here is my Handler.ashx class:

Public Class Handler
    Implements System.Web.IHttpHandler

    Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest

        '== Set up the response settings
        context.Response.ContentType = "image/gif"
        context.Response.Cache.SetCacheability(HttpCacheability.Public)
        context.Response.BufferOutput = False

        Dim id As Integer = -1
        Dim stream As Stream = Nothing
        If Not String.IsNullOrEmpty(context.Request.QueryString("id")) Then
            id = context.Request.QueryString("id")
            stream = GetImage(id)
        End If

        Const buffersize As Integer = 1024 * 16
        Dim buffer(buffersize) As Byte
        'byte[] buffer = new byte[buffersize];
        Dim count As Integer = stream.Read(buffer, 0, buffersize)

        While count > 0
            context.Response.OutputStream.Write(buffer, 0, count)
            count = stream.Read(buffer, 0, buffersize)
        End While

    En

image inside custom server control

  

Hi,

I want to use an image inside a Custom Web server control ! 

Do I need to use Web.resources ? if so , how to do ?


how to make a css style background image be linked to an image in the resource file

  

hey guy, i need help in a very troubling matter. I want to make a textbox with a specific style, within this style a set of images as background parts, how can i attach these images to the custom control as whenever i take the .dll file and add it to the toolbar the images do not appear. So i tried to make them as resource files and their property as embedded in .resx file, so how to make the css style background image url to be linked to any of those image.


thanks in advance


How to insert Image (jpeg) into MS Word Programmatically using VB.NET

  

Hi there,

Can someone help me on How to insert Image (jpeg) into MS Word Programmatically using VB.NET..not C#.NET??? Sad

I could hardly find any articles for the coding. Preferably using Bookmark...can i have the sample code.

Thanks,

 


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.


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