473,804 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The truth about LockBits

RT
It was mentioned here that LockBits can sometimes be vulnerable to the
GC. Though the implication of docs that I've seen regarding LockBits
would imply that it is immune to the GC, I do have an app where a
custom control seems to lose its buffer and starts displaying random
data. Of course that couldn't be a bug in my code. <g (it does seem
to wait a while, and it happens at random).

Seriously, has anyone heard of this? Any way to guard against it?
Jan 19 '07 #1
1 2177
RT,

What do you mean by LockBits can be vulnerable to GC? Unless you let go
of the Bitmap reference and the BitmapData instance, I don't see how that's
even remotely possible. On top of that, I can't see a situation where you
would let go of those references until your work was done.

Can you show a piece of code?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"RT" <rt@spamfree.xx xwrote in message
news:v5******** *************** *********@4ax.c om...
It was mentioned here that LockBits can sometimes be vulnerable to the
GC. Though the implication of docs that I've seen regarding LockBits
would imply that it is immune to the GC, I do have an app where a
custom control seems to lose its buffer and starts displaying random
data. Of course that couldn't be a bug in my code. <g (it does seem
to wait a while, and it happens at random).

Seriously, has anyone heard of this? Any way to guard against it?

Mar 29 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1632
by: lkrubner | last post by:
I've got a site on a hosted virtual server. I'd like to know the truth of what is going on, but I can't get past my browsers cache. There is some kind of error in my code that occurs on a given line. When I comment out that one line, everything else seems to work. When I uncomment that one line, the browser simply shows what was last on screen the last time the code was working. That is, if I write echo "hello"; while the line is...
0
1940
by: Learner Net via .NET 247 | last post by:
(Type your message here) What I am trying to do is create a bit map image from scatch using the managed C++ LockBits method. I want to display the bit map as a result of a button click. I have tried several alternative approaches but can't get it to work. I show some typical coding below as an example. Please excuse the errors as I am new to .NET and relatively new to C++ in general. Any help would be greatly appreciated. private:...
0
1376
by: Iwanow | last post by:
Hello! I'm using Bitmap->LockBits method to copy its pixels into an array according to example found on http://msdn2.microsoft.com/en-us/library/5ey6h79d.aspx . Now I need to use pixels' brightness. How do I get such info? I guess that requires some special PixelFormat argument. Thanks in in advance for all hints.
90
3473
by: John Salerno | last post by:
I'm a little confused. Why doesn't s evaluate to True in the first part, but it does in the second? Is the first statement something different? False print 'hi' hi Thanks.
3
8840
by: _DD | last post by:
I've heard that fast bitblt functions still need to resort to calling older Bitblt vs interop. Has this changed? Will GDI+ Lockbits come close to the speed of GDI BitBlt?
2
3855
by: =?Utf-8?B?VGhlTWFkSGF0dGVy?= | last post by:
I dont know if I missed something in documentation, but I was having a problem with "Bitmap.LockBits" and was wondering if anyone else has discovered it too. According to everyones examples including some of the MVP's website examples, one could use unmanaged code to manipulate a bitmap by casting the IntPtr from the Bitmap.LockBits to say an (int*). The problem I found is that the bitmap would rarely
2
1455
by: lemnitzer | last post by:
TV report: all 15 British sailors confess to illegally entering Iranian Waters Here are the links: http://news.google.com/news?hl=en&ned=us&q=all+15&btnG=Search+News http://www.canada.com/ottawacitizen/news/story.html?id=64454ab9-229c-44a8-9875-2f59e570c5f9&k=44029 NOW COMPARE THAT WITH THE YANK MOTHER FUCKING PEDOPHILE BASTARDS AND THE CORRUPT FBI BASTARDS COVERING UP FOR THEIR PEDOPHILE BOSSES:
6
11454
by: ambanks04 | last post by:
ok taking computer science class anybody know what to do i am not computer literate CoSc 111.003 Spring 2008 Assignment 4 1) Each student shall design, develop, code, test and submit an Original computer program which uses a function or functions to display the TRUTH TABLES for the Logical And, the Logical Or, and the Logical Not operators., as defined in Section 5.8, of the text, 5Th/6Th Edition. 2) The program shall: ...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10073
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.