Questions tagged [lockbits]

Part of .NET's System.Drawing Namespace - Bitmap.LockBits Method

Locks a Bitmap into system memory

Docs: https://learn.microsoft.com/en-us/dotnet/api/system.drawing.bitmap.lockbits?view=netframework-4.7

95 questions
0
votes
1 answer

How to write protect an NTAG203 NFC chip programmatically on android?

I've been looking into NTAG203 NFC chips for a membership card solution and intend to set up and write a unique ID onto each card. Oddly I can't find much online about how to write protect NTAG203 chips although I can find write-protected ones being…
Ali
  • 3
  • 4
0
votes
1 answer

DrawImage is slow, lockbits to the rescue?

I've read many C# tutorials on using lockbits to manipulate images, but I just don't know how to apply this info into PowerShell. This is the problem: $image1's height is 2950 pixels. $image2's height is 50 px taller, 3000 pixels. I need to fit…
Lunar Remedy
  • 37
  • 2
  • 9
0
votes
1 answer

How do I remove read only mode from NFC tag

I am using NTAG203 NFC tags. I made it read only mode by mistake. How can I change read only mode to writable mode?
user3678419
  • 11
  • 1
  • 4
0
votes
1 answer

Cropping white space from image right side in C#

I have some images, which contains a lot of white space at the bottom and the right side. I want to crop that white space before displaying to the user. So far I've implemented non-white pixels detecting from the bottom. Pixel format is…
0
votes
1 answer

BitLock-GetPixels. Time and PixelFormat

Okay, I've created two programs. One that uses GetPixels and another that uses LockBits. My GetPixels program is as follows... The stripe picture referred is a 200x200 jpg Stopwatch GetTime = new Stopwatch(); Bitmap img = new…
rguarascia.ts
  • 694
  • 7
  • 19
0
votes
1 answer

Problems with Lockbits and GetPixels

I am trying to get all the pixels in an image using a Bitmap and GetPixels. Now I know that it is very inefficient so I have been looking into LockBits. I have successfully made what I think locks the bits but I can not get each and every pixels. My…
rguarascia.ts
  • 694
  • 7
  • 19
0
votes
1 answer

Moving through each pixel for 1bpp Pixel Format

I had a question related to the use of Lockbits method in C#.. I have a 1bpp Image and I'm trying to access all the pixels of the image but some are still left out. public Bitmap Pixels(Bitmap original) { Rectangle rect = new…
Afifa
  • 5
  • 2
0
votes
1 answer

Why is my image considered open?

private void button4_Click(object sender, EventArgs e) { string originalPathFile = @"C:\Users\user\Downloads\CaptchaCollection\Small\Sorting\"; string newPathFile = @"C:\Users\user\Downloads\CaptchaCollection\Small\Sorted\"; bool…
puretppc
  • 3,232
  • 8
  • 38
  • 65
0
votes
1 answer

LockBits in Qt. How to implement?

Please tell me this analogue in Qt. How to implement this in Qt? Thx! BitmapData btmData= currentRegionMap.LockBits(new Rectangle(x, y, width, height), ImageLockMode.ReadOnly, currentRegionMap.PixelFormat); byte* a =…
GPPSoft
  • 480
  • 1
  • 6
  • 15
0
votes
1 answer

Removing image overlay using mask image

I'm writing a program that removes an overlay from a png image using the mask (the overlay image) having image 1 and 2 I want to achive image 3. I have tried using lockbits and tried many things but I can't do the math right I think rgbValues is…
Ashkan Mobayen Khiabani
  • 33,575
  • 33
  • 102
  • 171
0
votes
1 answer

LockBits() throws ArgumentException when rectangle on 2nd monitor

I'm working on a small application that needs to display some generated test screens on a chosen monitor. I'm generating these screens as bitmaps and for ease and speed of generation I'm using the LockBits() method to generate these bitmaps. The…
K_Trenholm
  • 482
  • 5
  • 20
0
votes
1 answer

c# copy array of structures as bytes using Marshal.Copy()

I'm having a problem with copying an array of structures as a byte array. The structures are simple RGB structs. public struct RGBColor { byte r; byte g; byte b; } Then I have an array of RGBColor[] that represents a scanline that I want to copy to…
0
votes
1 answer

Memory error when accessing pixel data using LockBits

I'm getting this error when using the code below to access the pixel data of three different bitmaps: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. C# code: var bmpDataA =…
Joey Morani
  • 25,431
  • 32
  • 84
  • 131
0
votes
1 answer

Corrupt memory with LockBits (DirectShow webcam)

I'm doing some image manipulation in .NET (VB 2010). I'm using the following code (which doesn't do anything yet): Sub Manipulate(IMG As Bitmap) ' Dim foo(100000) As Integer - will need it later... Dim bd = IMG.LockBits(New Rectangle(0, 0,…
Dave
  • 690
  • 4
  • 7
  • 16
0
votes
1 answer

VB.Net - Lockbits - Greater Than / Less Than functions

The following code works well for what I am doing. However, it is taking longer than I need it to. The problem is that it iterates over each greater than/less than function and that takes time. I've done some research but can't figure out how to…