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

C# Bitmap LockBits/UnlockBits in multi-thread

I am working on a CCTV project which employs ONVIF. I use a Winform sample, which is provided by "ONVIF Device Manager" project, to obtain video frames from a camera. (You can find it here). I found that the sample put a CopyMemory() block code…
John Pekl
  • 75
  • 7
0
votes
6 answers

AVR studio Error "Got 0xc0, expected 0x00"

so I have 5 board that uses an ATmega 2560 that I designed. They are all wired properly and initially were able to communicate with the AtmelStudio studio using an AVRISP mk2. The first board was able to flash, have the lock bit set and the fuses…
hahman
  • 21
  • 1
  • 1
  • 2
0
votes
0 answers

Window7 C# Debug & Release Program, Difference Value(Processing Bitmap)

I'm running a lot of tests on the two programs (Window7 C# Debug & Release Program). tag : Window7, C#, Bitmap, Lockbits, byte The contents are as follows. Bitmap spec(Image Size : 3072X3072) Bitmap originImage; int cnt = 0; BitmapData bmOrigin =…
user3669690
  • 83
  • 1
  • 1
  • 5
0
votes
0 answers

LockBits get pixel (X, Y)

Currently I have this, I am searching for the RGB value (208, 94, 94) and if there is a match, it will tell my DX device to draw on the screen and aswell log it in the console. Well, I am not exactly sure how to get the exact X,Y coordinates of the…
0
votes
1 answer

efficiently updating an image? (visual c#)

Im writing a program that requires a lot of updates to be made to a 1400 x 900 pixel image (approx every second or so). In my current build i have used a lockbits function which recalls data from an array (which i have used to store data about each…
0
votes
1 answer

How to stop a thread when a new one is initiated?

I'm improving the performance of a 3d engine i created, introducing LockBits and parallel processing. I have a class for the engine with the following method to update a bitmap with the result: public void draw() { clearbmp(); //…
0
votes
2 answers

Process Bitmap in C# using underlying buffer accessed with Bitmap.LockBits function

I need to do an analysis with an arbitrary image. I would like to start with the easiest example - just copy a image to picturebox. Bitmap foreImg = new Bitmap("input.jpg"); //output image Bitmap resImg = new Bitmap(foreImg.Width,…
Ilya
  • 45
  • 1
  • 8
0
votes
0 answers

Find Even and Odd columns and rows of Bitmap with LockBits() function

im using the second block code to find Even and Odd columns of a bitmap in order to build a Checkered page in bitmap i used my IsEven() and IsOdd() function i want to do this job with lockbits: public unsafe void DrawCheckeredPage() { …
alireza
  • 5
  • 2
0
votes
1 answer

Not able to successfully use lockbits

Hi i m really new in image processing in C# and the code below basically getpixel from the image I browsed from my computer and will compare the RGB value of the pixel with the right pixel and if its the same value, it will setpixel to cyan color.…
LouisL
  • 121
  • 1
  • 1
  • 11
0
votes
0 answers

Real-time (30fps) image processing vb.net

I'm not looking for any code here! My question is reasonably simple: could an average home computer feasibly run a 30 fps 1024x768 image processing alg using vb.net. Some more details; 1. I'm not expecting a hard yes. I'm hoping that no one can give…
FraserOfSmeg
  • 1,128
  • 2
  • 23
  • 41
0
votes
1 answer

LockBits image rotation method not working?

Hey all. I resorted to using LockBits for 2d bitmap image rotation after getting fed up with the slow performance and wacky behavior of both Get/Set Pixel, and RotateTransfom. So here is the code I've come up with, and by my reckoning, it should…
Bloodyaugust
  • 2,463
  • 8
  • 30
  • 46
0
votes
0 answers

images difference in byte array c#

i'm trying to do method that should return difference between two images in byte array(rgb values) and send it via UDP. Code: (there's no part with sending this array because it doesn't matter now) public void getdiff(Bitmap lol,Bitmap lol2) { …
KKKk
  • 93
  • 2
  • 15
0
votes
2 answers

Change alpha coefficient using Lockbits

I have written a function which changes the alpha coefficient of an image. I use setpixel and getpixel,which is very slow. I found out that Lockbits method is faster.How can I do it with Lockbits? Here is my current code: using System; using…
Rati Sharabidze
  • 69
  • 1
  • 12
0
votes
1 answer

Comparing images using lockbits not functioning correctly

I am trying to perform a basic number-only OCR on an image by comparing it to bitmaps of the numbers 0 - 9, using the code below. I have tried to follow the code in the answer to this question, but it is not returning the correct results. There are…
BrianH
  • 337
  • 1
  • 6
  • 12
0
votes
0 answers

System.AccessViolation Exception when using Marshal.Copy

I have seen similar posts on Stack Overflow, but none with quite the same as what I am trying to do. That's why I made a new question. I am trying to OCR a screenshot by comparing small parts of the screen to bitmaps of alphanumeric characters. (For…
BrianH
  • 337
  • 1
  • 6
  • 12