.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

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

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :Windows Application
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!

View Complete Post

More Related Resource Links

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  

Image copy/Paste on a asp.net webpage

  Hi All,            I need a help, in my project I have a requirement, which is I have to copy image from MS-Word and paste it on webpage directly. So that copied image should be display on webpage and save into server automatically. It can be possible using windows applications., but now the same functionality has to implement in asp.net web applications. Any help much appreciated. J Hint:  using javascript Clipboard functionality we may achieve it, but could get correct solution for this . :( Thanks, Naidu 

copy the image from table to disk drive

i have 2000  image he saved in the table "Employee" and i want to copy this pictures from table to diskdrive and save file name by the ID

What is difference between Panel's Visible-True/False and Setting Multiview's ActiveViewIndex ?

Hi, I have a panel that contains several controls. On the other hand i have a MultiView that contains Several view that in turn itself contains several controls . In multiview we have to set ActiveViewIndex for the view which we want to see. That same thing can be done through Panel containing another seleral panel's and setting its Visible property to True/False accordingly. Is seems Multiview  is just using this Visible property internally to render controls .Since other views (whose Index is not set to be active Index) are processed on the server for its Whole life cycle(I am confused here..whether i am right or not) .Same thing perhaps happen when we use a Panel insteed and use Visible=True/False. So, what is the difference between MultiView and Panel taking this scenario ?

I am using the following code to check to see if a panel is visible or not before running javascript

Using VB, VS 2010, when I run the following code, I get an error because it executes the code even if I have Panel7 set to invisible.  I am trying to use javascript to see if the panel is visible or not before executing the code.var panelRef7 = document.getElementById('<%= Panel7.ClientID %>'); if (panelRef7) { $find('DragP7').add move(savePanelPosition); }  What am I doing wrong?   Thanks

Strange Repeater Error, Object reference not set, Label not visible etc etc..

Hi Everyone,This is very strange and as of yet I cant seem to get round it, although it is a somewhat easy error to identify it is however becoming very annoying as everything I try doesn't seem to work...The repeater displays results for upcoming subscribers birthdays and after their day and month ("dd/mm/") I have a label to display the current year. This causes the old error of: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:  Line 55: Label lblYear = e.Item.FindControl("lblYear") as Label;Line 56: Line 57: lblYear.Text = DateTime.Now.Year.ToString();Line 58: }Line 59: As you can see the object is set correctly - The ASPX is below, for saving time on reading etc I've posted the repeater script only and not the whole page, although I can do if needs be.I've tried a number of things with subtle differences but to no avail: with Literal, same error - Tried inserting the year directly via <%#((system.datetime).now.year.tostring())%> or something to that effect, this also doesnt

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

Converting a System.Windows.Control.Image object to byte array.

Hi i need to convert a specific System.Windows.Control.Image object into an (int) array, because i'm trying to convert a silverlight application into a wpf project. private void createGi02GradBrush()<br/> {<br/> WriteableBitmap oWriteableBitmap = new WriteableBitmap(256, 256);<br/> Image oImage = new Image();<br/> oImage.Arrange(new Rect(0, 0, 256, 256));<br/> oImage.Measure(new Size(256, 256));<br/> oImage.Source = new WriteableBitmap(256, 256);<br/> Gi02GradShaderEffect oGi02GradShaderEffect = new Gi02GradShaderEffect();<br/> oGi02GradShaderEffect.pArray = oPImageBrush;<br/> oGi02GradShaderEffect.gi1GradArray = oGi1GradImageBrush;<br/> oImage.Effect = oGi02GradShaderEffect;<br/> oWriteableBitmap.Render(oImage, null);//here<br/> oWriteableBitmap.Invalidate(); <br/> this.oGi02GradImageBrush = new ImageBrush();<br/> this.oGi02GradImageBrush.ImageSource = oWriteableBitmap;<br/> } I've found some similar topics however Image object is not the same and most of its methods aren't available. Here I'm rendering a writablebitmap with a given Image object, but in wpf we need an array. oWriteableBitmap.Render(oImage, null); Any idea? Thanks. Joseph.  

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 ? 

page inside update panel doesn't refresh the session object after postback of any control



I have many controls like dropdown, radiobuttonlist, etc on my page and I put all these controls inside the update panel so that the page doesn't look to be posting back when something is selected. Now the working on the page is very smooth. But the session object isn't getting refreshed even if I postback to the server and as a result even if the users are working on the page they are being sent to the login screen after 20 mins.

Is there anyway where I could put all the controls in update panel and still refresh the session after any postback(dropdown selection)

Any help is greatly appreciated.

Thanks in advance

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.


Change background when "new" image is visible



I would like to change the background-color in my XSLTListView, when the ms-newgif is visible in a row.

How can I check in XSLT if the image is vivisble ?



Converting an Image/BitmapImage object into Byte Array and vice versa

Hi,  I have an requirement of developing an application (WPF) that recevies image object from WCF service.

my approch is to convert the image object into stream of bytes (Byte array) in WCF part and then send to  client application. Then client application converts the byte array back to image object.

I am not able to find right sample for my approach.

would you give me guidance and would be gr8 if you provide some samples.


Zooming in on specified area on a Image control.


I have an ImageControl within a Grid, that displays an image I want to be able to zoom in on the area of the image where the mouse down occured - just to make that area more visible to the user - but the image as a whole should stay the same size within the control, How would I do that, I tried applying a scaleTransform but the image did not remain the same size - any suggestion?


How to make a panel visible based on the validation of a text box?



I have a text box and some validation on it. I want to make a panel visible only when

it is successfully validated,i.e.,textbox entry is valid.Also,I want to capture the entered valid value(it should be integer within 1-8) in a session,based on this number,I am going to add that many rows in an editable grid view.

How to do that?

Error adding image to Rich Content Area - Missing ContentPlaceHolders


Hello forum

I've recently installed a standalone SharePoint Foundation, and it seems to be working well. But today I tried to edit a Rich Text field /SitePages/StartPage.aspx file, and it threw an exception complaining about a missing ContentPlaceHolder. So I've tried comparing the "faulty" master page to a working one, and they're identical. I've searched the master page code for the ContentPlaceHolder - it's nowhere to be found.

What I've found is, that the page that fails resides in the /_layouts directory and a master page with the same name exists there as well.

Does anyone know what I can do to make this error go away?


PS.: I haven't modified the v4.master or any other master page for that matter.

This is the stack trace:

Server Error in '/' Application.

Cannot find ContentPlaceHolder 'PlaceHolderRteDialogBody' in the master page '/_catalogs/masterpage/v4.master', verify content control's ContentPlaceHolderID attribute in the content page. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: Cannot find ContentPlaceHo

ssrs - expand image not visible when viewed in IE



I have created a tabular report in SSRS. The report drills down to monthly level when toggle image (+) is clicked. When this report is viewed in Firefox, it gets expanded & collapsed and the proper toggle image is displayed. The same report when viewed in IE doesn't expands and hence the toggle image remains as is (just the page is refreshed).

Note: A dashboard is created in sharepoint 2010 and deployed. 

Please help.



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