.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

Problem with Graphics.DrawImage method in .Net on Windows 7 OS

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :.NET Framework


We are displaying bitmap image on winform header in our dotnet application. It is displayed well on all windows operating systems. But, the same dotnet code if it runs on windows7, it does not display the image on the form. Can you please help me? Here is our code:


Dialogbase {


Rectangle captionRect = new Rectangle(0, 0, 0, 0);


View Complete Post

More Related Resource Links

Problem with overriding OnPaint method of System.Windows.Forms.Textbox

Hi,   I want to change the border colour of the Textbox. However, when I override the OnPaint method, some strange behaviour occurs.   The new border is drawn, as is the textbox background. However, the text itself appears in bold and only while I actually type something in, afterwards it disappears. I have provided a sample of my code here:         protected override void OnPaint(PaintEventArgs e)         {             base.OnPaint(e);             Rectangle rect = new Rectangle(0, 0, this.Width, this.Height);             ControlPaint.DrawBorder(e.Graphics, rect, _BorderColour, ButtonBorderStyle.Solid);         }   I have also set the style of the control to Userpaint, so that the paint method is actually used. Does anybody know how to solve this issue?

Resize and Crop an image using the graphics.drawimage method


Hello all,

I have been pulling out my hair trying to get this figured out and I need to tap the wisdom of the dotNet elite.

I am running dotNet 3.5 (VB.NET) , IIS7, Windows 7.

Basically, I have constructed a UI using a combination of two JQuery tools. JCrop and Resizable. Both are working on the client side and I need to save the optionally resized and optionally cropped photo after the user has completed their image manipulation.

At the moment, I have a class file that resizes images on the fly and crops them. But they scripts to handle the resized image and the cropped image are separate.

Here is the specifics:

            Dim image As New Bitmap(ThumbWidth, ThumbHeight)
            Dim g As Graphics = Graphics.FromImage(image)

            ' Load the file data.
            Dim thumbnail As System.Drawing.Image
            If ImageProcessType = ProcessType.Filename Then

Dazzling Graphics: Top Ten UI Development Breakthroughs In Windows Presentation Foundation


The Windows Presentation Foundation provides new techniques for UI-based developing applications and makes better use of current hardware and technologies. In this article, Ian Griffiths and Chris Sells explain 10 of the most significant advances that make WPF superior to its Win32 predecessors.

Ian Griffiths and Chris Sells

MSDN Magazine January 2006

Windows 2000: Asynchronous Method Calls Eliminate the Wait for COM Clients and Servers


Windows 2000 is the first version of COM to support asynchronous method calls, which permit clients to make nonblocking calls to COM objects and objects to process incoming calls without blocking the calling threads. COM clients benefit from asynchronous method calls because they can continue working while waiting for outbound calls to return. Objects benefit because they can queue incoming calls and service them from a thread pool. Our SieveClient and SieveServer sample apps demonstrate how to create and use asynchronous clients and servers in COM-based distributed applications.

Jeff Prosise

MSDN Magazine April 2000

Problem with Finder method with parameters



Could someone explain me how to provide some value to the parameters in a finder method. For exemple I know that the BDC list WP use this method. Is there a way to provide some value for those parameter at runtime? I really don't understand (even after some deep search on the web) where are the values for the parameters from and how we can connect to them. Even with C# code I can't find any information on how it work.

I don't want to define my parameters as filter in the ADF because then I will have this filter section in my BDC list WP (or is there a way to get rid of that?). Actually one of the parameter should be automatically calculated from a value in a SP list, the other parameter should be provided by my own filter web part.

Thank you for your help.

Wickedly Strange .Net WPF Performance Problem Dissapeers with Windows 7 Performance Monitor Open

Hello Everyone, I have been developing one large and complex WPF application for 13 months now, all is going well and especially tonight as I now have some sort of clue or hint to what I have been seing now for quite some time.  Here is the rundown. 1) Running on i5 processor with 4GB RAM and Windows 7 2) The application was developed all in .Net 4.0, WPF C#. 3) It is heavily GUI intensive and also uses Entity Framework Detached for Database Access. 4) Is multi-threaded / multi-tasking. I am a nutcase when it comes to testing.  Since my graphical application heavily depends upon performance and determinsm (please somebody don't start with the C++ vs .Net on here) and has been performing great FOR THE MOST PART.  Every once in a while, I see that the application runs into the weeds for 5 or 6 seconds and the interface is unresponsive.  I have this thing tuned finely too.  Well now toward the end of development I have finally had to face that bug so to speak.  I can force it by clicking spastically on my buttons causing an event storm and making the system update the GUI.  SO!  Great start, I can now cause the problem on a regular basis (for you youngsters that is actually a good thing)!  Alright, so I start with the easiest investigative tool, CNTRL - ALT - DEL into Windows 7 Performance Monitor.  As you can tell from

Cash Drawer - Method Open threw an exception - Windows Service

Hi All, I'm getting the following exception while calling Open method of Cash Drawer object. Method Open threw an exception.  Could not read the device name key's default value, or could not convert the Programmatic ID it holds into a valid Class ID. Code:   class Class1 { CashDrawer _uniCashDrawer1 = null; DeviceInfo cashDrawerDevice1 = null; PosExplorer posExplorer = new Microsoft.PointOfService.PosExplorer();   public void ClaimCashDrawer() { cashDrawerDevice1 = posExplorer.GetDevice("CashDrawer", "testDrawer"); if (cashDrawerDevice1 != null) { _uniCashDrawer1 = posExplorer.CreateInstance(cashDrawerDevice1) as CashDrawer; if (_uniCashDrawer1 != null) { _uniCashDrawer1.StatusUpdateEvent += new StatusUpdateEventHandler(UniCashDrawer1_StatusUpdateEvent); _uniCashDrawer1.Open(); _uniCashDrawer1.Claim(0); _uniCashDrawer1.DeviceEnabled = true; } } } }   Tha above code works fine if you put the code in WindowsApplication in all POS systems. The same is working if you put the code in Windows Service in all other POS systems. The same is not working if you put the code in Windows Service in Aures Galeo POS systems.  Thanks in advance. Ramakrishnan S

MSSQL Management Studio + Windows 7 pro = Problem ?

Hello, My DBA was using Windows XP + MSSQL Management studio 2005 (no SP applied). Everything was fine. Now we upgraded his machine to Windows 7 Pro and MSSQL Management stuio is crazy. We are unable to open 6000 row tables. The program freez and burn 2gigs of memory.   Do I miss something ? SP3 is applied and its still doing nasty things.   MSSQL Stuio Management version : 9.00.4035.00   Thanks !

Sharepoint 2003 + Windows Terminal Server 2008 + Office 2007 problem?

Hi, We have a customer where some users runs Windows Terminal Server 2008 with Office 2007. They open documents from a Sharepoint 2003 site. When they open an excel sheet they get a button in the document which says "Server workbook: Click edit workbook to edit this workbook" and there is a button: "edit workbook" The users clicks "edit workbook" but get an error message saying there is no connection to the server.  They are able to edit the document, but not save it back to the sharepoint site. Most other users work on their local computer with Office 2003. Here, everything works fine and there are no button/message stating its a server workbook.   Is this caused due to some compatability issues between Sharepoint 2003 and Office 2007?   Best regards, Thomas Hansen ErgoGroup AS

Problem with displaying printDialog on Windows 7 64 bit

Hello.   I'm having problems with displaying PrintDialog on Windows 7 64 bit. I checked other threads on this forum and unfortunately none of the solutions worked for me.   Here are some experiences: 1. UseExDialog option does not work for me. If set to false the PrintDialog does not show at all. If set to true PrintDialog.ShowDialog() method throws SEHException. Below You can find exception stack trace: StackTrace "   in System.Windows.Forms.UnsafeNativeMethods.PrintDlgEx(PRINTDLGEX lppdex)\r\n   in System.Windows.Forms.PrintDialog.ShowPrintDialog(IntPtr hwndOwner, PRINTDLGEX data)\r\n   in System.Windows.Forms.PrintDialog.RunDialog(IntPtr hwndOwner)\r\n   in System.Windows.Forms.CommonDialog.ShowDialog(IWin32Window owner)\r\n   in printerDialogTest.Program.Main(String[] args) w C:\\Users\\plcmiodu\\Documents\\Visual Studio 2008\\Projects\\printerDialogTest\\printerDialogTest\\Program.cs:line 19" string 2. Setting Platform target in Build to x64 does not work either. Behaviour is exactly the same as above. 3. Setting dialog owner to this (ShowDialog(this)) does not work either. Behaviour exactly the same. The code I used for testing is as simple as possible: using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using System.Drawing.Printing; namespace printerDialogTest {  &

Problem facing in Deployment on Windows Server 2003

Hi All I have deployed my MVC 2 apllication on Windows server 2003 under iis 6.0. I am using Nhibernate for data access. I could deployed it but when i browse the application it is redirecting to Error.aspx Page. It is not showing any stack trace. Can anyone guide me why it is happening. Thanks sskulkarni.

Problem with .Net framework 4.0 on IIS 7 on Windows Server v2008 64 bit machine

Hi, I have installed .Net framework 4.0, i have added one application in default website, now when i brows the login page, it take some time and at the end displays nothing, in the event viewer in system log it says myApplicationName crashed.And also i get folllowing in event viewer Application LogLog Name:      ApplicationSource:        Application ErrorDate:          7/29/2010 11:39:31 AMEvent ID:      1000Task Category: (100)Level:         ErrorKeywords:      ClassicUser:          N/AComputer:      dev-appDescription:Faulting application name: w3wp.exe, version: 7.5.7600.16385, time stamp: 0x4a5bd0ebFaulting module name: clr.dll, version: 4.0.30319.1, time stamp: 0x4ba21eebException code: 0xc00000fdFault offset: 0x000000000000400cFaulting process id: 0xad8Faulting application start time: 0x01cb2ef990316804Faulting application path: c:\windows\system32\inetsrv\w3wp.exeFaulting module path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dllReport Id: ce52c718-9aec-11df-8551-00155d701c03Event Xml:<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">  <System>  

Problem consuming 32bit WCF service which references a native Dll in a 64 bit OS(Windows Server 2008

I have some 32bit Dlls which i want to use it in 64bit OS as i do not have a source code of this to recompile it for 64 bit OS. I have created a x86(32 Bit) WCF service which calls these Dlls and hosted it as a Windows Service on a x64(64 Bit) machine using Windows Server 2008. I have created one more x64 client which calls a function in the WCF which in turn calls a function from the 32 bit native Dll. Whenever i try calling this WCF from the client I get an error as given below.Can anybody please guide as to where I am going wrong and what is needed to solve this issue. Thanks in advance for any help.******The Error Message********************System.BadImageFormatException: Could not load file or assembly 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.File name: 'TestWCFWrapper, Version=, Culture=neutral, PublicKeyToken=null'   at TestWrapperWCFClient.Form2.button1_Click(Object sender, EventArgs e)   at System.Windows.Forms.Control.OnClick(EventArgs e)   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)   at System.Windows.Forms.Control.WndProc(Message& m)   at System.Windows.Forms

Problem in setting up Windows Authentication in Windows 2008 RC2

Hi,We have a working version of application (Intranet) with uses Windows Authentication deployed in Windows 2003. The application uses HttpContext.Current.User.Identity.Name to get the logged-in user. Here impersonate is turned off.Right now, we are move to Windows 2008 RC2 where this Windows Authentication problem arised. I have Digest Authentication and Windows Authentication enabled. And also I have enabled Anonymous Authentication enabled to avoid the Login dialog of IIS in the end-user IE. Now I am getting HttpContext.Current.User.Identity.Name as Empty. When I impersonate using username and password, I am used to login using that user but all the users uses the same user to login.Does any has solution for this?Deployment Server - Windows 2008 RC2 (IIS 7.5)Development - Windows 7 (IIS 7.5)I am new to IIS 7.5. Please give me a solution

Graphics.DrawImage(image, bounds) vs SetResolution

Hi    this is what I am undertanding.   Image object never store inch information, it is two-dimentional array of pixels, thus Image object don't have a DPI.    so I conclude that Image.SetResolution is actually changing the Image width and height with the current Graphics.InterpolationMode   from the naming of enumerations of Graphics.InterpolationMode I conclude it is a Re-Sampling algorithms.   thus   If I am drawing image in terms of inches then   Image.SetResoultion(Image.Width * someFactor/ DPI, ........);  Graphics.Draw(Image)   is equivalent to   Graphics.Draw(Image, Bounds in inch)   Can some one validate this?

WPF method call between 2 Windows

I have a Window called MenuWindow and ControlWindow and I wanted the call a method void Sync() in ControlWindow from MenuWindow Im confused because i havent done this through 2 windows that were not the MainWindow. Normally i would do it like so ((MainWindow)Application.Current.MainWindow).Sync(); but how do i do it if its not the main Window?

Problem installing Cumulative Update 6 for SQL 2008 SP1 on Windows XP

I am attempting to apply SQL Server 20008 SP1 Cumulative Update 6 on my Windows XP desktop. The update executable is unpacked and I get a brief flash of a Command Screen and then nothing. I have searched for any update files but have not found any. My Desktop Configuration: Windows XP SP3, Windows Installer 4. SQL Server 2008 SP1 Developer Edition. I am also attempting to install the Client Tools for SQL 2008R2 on this same desktop and am getting the same results. I click on SETUP and get a brief flash of the Command Screen and the installation does not continue. Internet searches speak of a problem with a registry entry in the Boostrap Key for a valid Setup directory, but this key exists in my desktop registry. Thanks,
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