.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

Image doesn't show anything

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :WPF

Hi, in my WPF application, there is a list of PDF documents. There is a FileSystemWatcher looking for new PDF documents appearing in a directory. When a new PDF file appears, a I generate a thumbnail and add a new item to the list. The problem is that I cannot make the image display the thumbnail. I tried two approaches:

1. I use QuickPDFLibrary to extract a page as image and to save it to a file in PNG format. Then I read create a BitmapSource object that is returned from the method. It is set afterwards as the source of the list item's image.

public BitmapSource preview(int pageNumber)
  BitmapDecoder decoder;
  BitmapFrame bitmapSource = null;
  string thumbnailFile = Environment.GetEnvironmentVariable("TEMP") + "\\" + documentHandle.ToString() + ".png";
  FileStream fileStream = null;

  // save the page as a PNG to the thumbnailFile
  // .....

  // At this point, the image is saved in the file. When I open it, it looks fine. 


View Complete Post

More Related Resource Links

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() {
        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" />

I above code works perfectly and the slide show e

SSRS Report based on SSAS Cubes doesn't show NULL values correctly

I have a SSRS report which is based on an SSAS Cube. In the Cube the formating of numeric fields that NULL values are properly shown as NULL values. In the Cube Browser and Excel this is shown correctly. However when I design the report already the query against SSAS shows these fields as "0" instead of NULL. Is there a way to fix this or is this a bug ?  

Can not show image in Filter drop down menu in SPGridView - Sharepoint 2007

Hi, I can not show image in the filter drop down menu (at header) of SPGridView in Sharepoint 2007.  For example: I have 3 rows as "_layout/images/1.gif", "_layout/images/2.gif", "_layout/images/3.gif". When user click on the column's header, the SPGridView just displayed filter menu and it always displayed the text (_layout/images/1.gif) not an image as I expected. So please help me to solve this problem. Thanks a lot Dan

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 show the image in crystal report 9 in asp.net 2.0

Hi, I'm using crystal report 9 in asp.net 2.0 web site. i couldn't display the image in report. is anyone having idea about this? i put the image using Insert Picture. in my web config , i put following codes,<httpHandlers> <add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/> </httpHandlers> <appSettings> <add key="CrystalImageCleaner-AutoStart" value="true" /> <add key="CrystalImageCleaner-Sleep" value="60000" /> <add key="CrystalImageCleaner-Age" value="120000" /> </appSettings> Thanks S.Shangar

Web Part Page doesn't show current navigation

Hi! I'm having a problem with the navigation of web part page in Sharepoint 2010. For starters I need to say that I am a web designer and learning to brand Sharepoint 2010 wich means I'm not that tech-savvy so bear with me. We have created an intranet publishing site with Sharepoint 2010 and I have designed a custom master page with styles through Visual Studio 2010. The intranet site looks fine with the new design and I got navigation working with fly out menus, semantic subpages etc. The problem is: when I create a normal page the current sub-navigation is shown and it even shows my created web part page and all is fine, but once I go to this web part page, the left/sub-navigation disappears and I have no idea how to bring it back. The web part page uses the same master file as every other page. Everything with the the layout stays the same as my masterpage, except for the menu wich disappear so I thought it might be some property missing on the sub-navigation. Or do I need to edit something in the web part page layout in the gallery?: Master Page Gallery > BlankWebPartPage.aspx If so can I do it from Visual Studio? Here is the code for the left navigation menu: <!-- styles needed to have left nav to the left of the main area --> <div id="s4-leftpanel" class="s4-notdlg"> <!-- The quick launch bar / left navigation

Using jQuery .hide() and .show() on panel sets doesn't maintain status through postback. Viewstate

I'm using jQuery against a set of three asp panels.  I set up an 'onChange' function for a dropdown list that dictates which panels to hide and show based on the UI selection.When the page first loads, one of the panels will be shown, the others will be hidden.  Let's say pnlOne is showing because the dropdown has option 1 selected.  This is done on the server with this:pnlOne.Style.Add("display","block");//and all the other panels are set to ".Style.Add("display","none");" based on logic.Then, the user selects a different value in the dropdown.  Let's say they select option number 2.  With javascript and jQuery I do this:$("#<%=pnlOne.ClientID %>").hide();$("#<%=pnlTwo.ClientID %>").hide();$("#<%=pnlThree.ClientID %>").hide();switch($("#<%= ddlOptionNumber.ClientID %> option:selected").text()){case "1":$("#<%= pnlOne.ClientID %>").show();break;case "2": etc.,}The issue is when the page posts back.  I'm running client side validation only at this point.  (Even if I add client side in the future I will still run client side as well to avoid security issues.)  When the validation functions detect an issue and the page returns to be displayed, the original panel (pnlOne)

trying to show new image in ajax slidehow extender immediately after uploading it

 hi,   On my aspx page I have a slidshow extender.   In the code behind I am filling a data table from the datbase and using GetSlides() Method to show the images in the slideshow. The problem is I have a file upload control on the page as well. When I upload  a new file I am expecting it to show in the slideshow after postback but it does not. Only when I click refresh again or cause another postback the second time does the new image show.   My code behind    private static DataTable tblData = new DataTable(); protected void Page_Load(object sender, EventArgs e)         string strSQL = "(my select query is here";        SqlConnection conn = new SqlConnection("Data Source=(mydatasource here");        conn.Open();            SqlDataAdapter da = new SqlDataAdapter(comm);        tblData = new DataTable();        da.Fill(tblData);         conn.Close();           // set the initial image        if (tblData.Rows.Count > 0)        {    

select image , show image, crop image and then submit to server.

How do i do this using javascript, asp.net 3.5 and C# ?step 1) user selects the image using browse buttonstep 2) clicks on upload button -- when user clicks on upload button i have to show the image immediately before sending the image to server, because, 1) image size could be very large 2) image dimensions could be long where my application shud not accept.step 3) ask the user to select the region (like face) from the image, zoom in /zoom out step 4) click on submit button to send the selected region to the server and then save it on the server as image.I have seen couple of tools but are not useful to me.Is there any tool that follow these steps?I want to do the work @ client side,with which 1) i can reduce the amount of data transfer.2) user have the option of selecting the image and play around with it.any help would be highly appreciated.thankssuman

Show hyperlink and popup window when Mouseover on image !

Hello , I am developing a web application using asp.net, telerik RadAjax control. I have to need to develop when mouseover the image then show a hyperlink and when click the clink then open a new window(like facebook profile picture change). Please Help me...

Show image after upload at same time

I want to show uploaded image at same moment. I use this code: protected void FileUploadLaptop_UploadedComplete(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e) { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "size", "top.$get(\"" + lblErrorMessage.ClientID + "\").innerHTML = 'Uploaded size: " + FileUploadLaptop.FileBytes.Length.ToString() + "';", true); string savePath = MapPath("~/Uploads/" + System.IO.Path.GetFileName(e.filename)); FileUploadLaptop.SaveAs(savePath); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "image", "top.$get(\"" + imgLaptop.ClientID + "\").src = 'Uploads/" + System.IO.Path.GetFileName(e.filename) + "';", true); imgLaptop.ImageUrl = savePath; imgLaptop.DataBind(); } *** Picture upload to path but image control doesn't show it. what is wrong?

How to retrive client name ,Field , and Image from Database and show in datalist?


hi experts,

i wanat to display Client Name, Field and  image in datalist. Stored Procedure like this

ALTER proc [dbo].[get_clients_services]
SELECT     Clients.ClientName AS Client, Fields.FieldName AS Field, ServiceType.ServiceType AS Services, ServiceType.Servicelink AS Link, 
                      Clients.ClientLogo AS Logo
FROM         Clients INNER JOIN

Loading please wait image show hide



I am trying to implement the loading please wait image funtionality while controls refersh on the page. Here are steps I have taken:

1. Added the image to the .net solution file in the image folder.
2. Added a div with the hidden class that holds the image source on the webform.

Image loads hidden by default and I am trying to show it when any postback or partial post back occurs. There are several controls like dropdowns, checboxes, gridview etc and links in the gridview that could take a few moments to load so I want to display the loading please wait while they reload after selections are made. All Controls exist in the update panel. I can't figure out how to show the image and hide it again when controls are reloaded. I am trying to add to this existing jQuery, my challenge is events occur after the document has been loaded so I need to add Ajax events to this query to show hide the loading please wait image. Here is what I have so far

//Dialog box settings

$(document).ready(function() {

    // $("mytest").dialog({
        title: "   Test",
        resizable: false,
        modal: true,

DropDownList selection doesn't show


I've got two DropDownLists that are filled using a couple of SqlDataSources, like so:

    <asp:SqlDataSource ID="dsCategories" runat="server" 
    ConnectionString="<%$ ConnectionStrings:EPiServerDB %>" 
    SelectCommand="img_GetCategories" SelectCommandType="StoredProcedure">
            <asp:Parameter DefaultValue="1" Name="CountryID" Type="Byte" />
    <asp:DropDownList ID="categories" runat="server" AutoPostBack="True" 
    DataSourceID="dsCategories" DataTextField="Translation" 
    DataValueField="CategoryID" Width="220px">
    <asp:SqlDataSource ID="dsSubcategories" runat="server" 
    ConnectionString="<%$ ConnectionStrings:EPiServerDB %>" 
    SelectCommand="img_GetSubcategories" SelectCommandType="StoredProcedure">
            <asp:Parameter DefaultValue="1" Name="CountryID" Type="Byte" />
            <asp:ControlParameter ControlID="categories" DefaultValue="" Name

show image in gridview from sql database


how to show image in gridview from sql database

why image in custom control does not show


I have added an image(bold.png) and an html file(test.html) into server Control project and set those Bulid Action property to Embeded Resourse.

i registered html and image file in AssemblyInfo.cs :

[assembly: WebResource("ServerControl2.test.htm", "text/html", PerformSubstitution = true)]
[assembly: WebResource("ServerControl2.bold.png", "image/png")]
[assembly: WebResource("ServerControl2.test.htm", "text/html", PerformSubstitution = true)]
[assembly: WebResource("ServerControl2.bold.png", "image/png")]

now i want show that registered image(bold.png) into the html file(test.html).
i try it like this :
	    <img src="<%= WebResource('ServerControl2.bold.png') %>" />

WSS 3.0 Doesn't show all the processes



In an article i read that Sharepoint will show unique process for each service in TaskManager.

1. WSSADMIN - for SPAdmin

2. OWSTIMER - for SPTimerV3

3. WSStracing - for SPTrace

4. SPWRITER - for SPWriter (When requested).

But in my server when i check task manager list of processes, i see only wsstrace process.


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