Quick and Easy SetPixel replacement function

xilef

Member
Joined
Oct 31, 2009
Messages
6
Programming Experience
1-3
I've been looking for weeks now, most people seem to be writing GetPixel replacement functions that speed up GetPixel, but I need SetPixel.
I've read over the locking/unlocking bits articles, but they don't explain to me, how do I simply set a colour of a pixel?
Something easy like:
setpixelreplace(mybitmap, x, y, color.red)

I've been trying to write this myself for ages now, keep getting all sorts of weird things happening, closest I have is making the screen entirely black or entirely white, however when using setpixel i can view my image absolutely perfectly.
MessageBox.png

It just runs slow on bad computers (Takes them 0.2 seconds to render a frame, absolutely horrible)

I don't mind any pixel format being used, the buffer is flexible and i can change it to anything, just please, someone out there, help me out!! T_T

I'm sick to death of reading about getpixel replacement functions here that have no clear way of being edited to set a pixel at all#

I'm using Visual Basic .NET

I know what VB is doing, I know about unlocking bits, I know about it all just can't write the function I need.
 
You'll want to check out using LockBits: Using the LockBits method to access image data
man, that's the ONE page I've read over a billion times, it just doesn't have any good examples, it's all hey you can do this, but no indication of where to customise.

Perhaps I didn't stress enough how much I simply want a function that I can call, I've seen all the links about locking bits, all the links about how crappy setpixel and getpixel is, I've seen a thousand different functions for a getpixel with pixel locking but NONE for setpixel, at all, well there is one but the code is broken and is based on a getpixel function that's what I want.
 

Latest posts

Back
Top