Click here to Skip to main content
15,921,990 members
Home / Discussions / C#
   

C#

 
General.NET Framework Version Pin
Jamie Nordmeyer29-Jul-02 12:57
Jamie Nordmeyer29-Jul-02 12:57 
GeneralRe: .NET Framework Version Pin
Feng Qin29-Jul-02 17:19
Feng Qin29-Jul-02 17:19 
GeneralRe: .NET Framework Version Pin
James T. Johnson29-Jul-02 20:21
James T. Johnson29-Jul-02 20:21 
GeneralRe: .NET Framework Version Pin
Jamie Nordmeyer30-Jul-02 6:16
Jamie Nordmeyer30-Jul-02 6:16 
GeneralRe: .NET Framework Version Pin
Andy Smith30-Jul-02 8:36
Andy Smith30-Jul-02 8:36 
GeneralRe: .NET Framework Version Pin
Jamie Nordmeyer30-Jul-02 8:40
Jamie Nordmeyer30-Jul-02 8:40 
GeneralRe: .NET Framework Version Pin
Andy Smith30-Jul-02 10:47
Andy Smith30-Jul-02 10:47 
QuestionClipboard copy to Bitmap losing memory? Pin
Richard Carpenter29-Jul-02 11:17
Richard Carpenter29-Jul-02 11:17 
Hi, I have a little problem with the 'Clipboard' class. I am attempting to transfer data from the windows clipboard to a bitmap object and appear to be leaking memory. The following code placed in a button on a windows form will cause a significant amount of memory to be allocated and only partially freed. You must manually 'copy' an image onto the clipboard prior to running this code.

System.Drawing.Bitmap bm;
IDataObject iData;

iData = (IDataObject) Clipboard.GetDataObject();

for (int i = 0; i < 100; i++)
{
if (iData.GetDataPresent(DataFormats.Bitmap))
{
bm = (Bitmap) iData.GetData(DataFormats.Bitmap);
if (bm != null)
{
bm = null;
}
else Console.WriteLine("Bitmap was NULL");
}
}

If the 'bm=(Bitmap)...' line is commented out no memory will leak.
I have been using an approximately 512x512x32 BMP for my tests.

Note : This code is simply to test the leaking problem. The real code places a different image on the clipboard every time through the loop and then works with the data in the if (bm != null) {...} block.
AnswerRe: Clipboard copy to Bitmap losing memory? Pin
Eric Gunnerson (msft)30-Jul-02 8:48
Eric Gunnerson (msft)30-Jul-02 8:48 
GeneralRe: Clipboard copy to Bitmap losing memory? Pin
Richard Carpenter30-Jul-02 9:05
Richard Carpenter30-Jul-02 9:05 
GeneralDisk Format Pin
Jassim Rahma29-Jul-02 10:49
Jassim Rahma29-Jul-02 10:49 
Generalbring to front Pin
SHaroz29-Jul-02 9:27
SHaroz29-Jul-02 9:27 
GeneralRe: bring to front Pin
Nathan Blomquist29-Jul-02 9:50
Nathan Blomquist29-Jul-02 9:50 
GeneralRe: bring to front Pin
SHaroz29-Jul-02 10:21
SHaroz29-Jul-02 10:21 
GeneralRe: bring to front Pin
Nathan Blomquist29-Jul-02 12:17
Nathan Blomquist29-Jul-02 12:17 
GeneralRe: bring to front Pin
Luis Alonso Ramos29-Jul-02 12:14
Luis Alonso Ramos29-Jul-02 12:14 
GeneralRe: bring to front Pin
SHaroz30-Jul-02 5:06
SHaroz30-Jul-02 5:06 
GeneralScheduled Tasks Pin
cAptHiDDeN29-Jul-02 9:22
cAptHiDDeN29-Jul-02 9:22 
GeneralRe: Scheduled Tasks Pin
James T. Johnson29-Jul-02 18:00
James T. Johnson29-Jul-02 18:00 
GeneralRe: Scheduled Tasks Pin
cAptHiDDeN30-Jul-02 2:29
cAptHiDDeN30-Jul-02 2:29 
GeneralDelegate argument question/suggestions... Pin
Ryan Cromwell29-Jul-02 6:32
Ryan Cromwell29-Jul-02 6:32 
GeneralRe: Delegate argument question/suggestions... Pin
Eric Gunnerson (msft)29-Jul-02 10:53
Eric Gunnerson (msft)29-Jul-02 10:53 
GeneralRe: Delegate argument question/suggestions... Pin
Ryan Cromwell29-Jul-02 17:42
Ryan Cromwell29-Jul-02 17:42 
GeneralRe: Delegate argument question/suggestions... Pin
Eric Gunnerson (msft)30-Jul-02 8:41
Eric Gunnerson (msft)30-Jul-02 8:41 
GeneralConverting images Pin
Ahmed Diaa29-Jul-02 5:55
Ahmed Diaa29-Jul-02 5:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.