R0b0t1
2007-12-02 16:39:19
Hokay. First off this is in a plugin. GET IT?
I have a plugin with a function named DumpPixels. Its purpose is to take a section of the screen and place it into a two-dimensional integer array. Why would I want to do this? Well, I had an experiment to see if I could make a color finding function faster than SCAR's in scar… And, its to help someone.
I'll include the plugin, so you can see the error. Simple type "DumpPixels(" and wait for the codehint to come up…
Plausible reasons anyone?
Harry
2007-12-02 16:40:48
Rawr.
I don't inderstand what you did here. Elaborate?
R0b0t1
2007-12-02 16:45:04
Take out the plugin out of the zip file and put it in SCAR. Type in "DumpPixels(" and wait for the code hint.
I need to fix it
mastaraymond
2007-12-02 17:07:58
Wtf? Why don't you just do include Graphics, Windows
These functions are already declared..
EDIT: You already do lolled.
EDIT EDIT: Wtf? You need to put in a Pointer to a RGBA Type array.. And you put in a 2D integer array? :\.
Also 1 tip. GetDiBits isn't a easy function to get to work..
R0b0t1
2007-12-02 17:46:35
I know all of what you just said. (EDIT: Actually, not the stuff in the Graphics and Windows unit :rolleyes:)
But if you would have actually looked at the C++ documentation or the VC++ codehints, you would know that you do not need an RGBQUAD array… Its actually a LPVOID, or a typeless pointer. You can put any shit you want in it, as long as it makes since to the computer. If you specify a array of dwords/ints/bools/strings, it will fill that array with the numerical (in the case of a string, something else…) values for the colors.
:p
EDIT EDIT: Thanks, it works now. Mwuhahahahaha! (I just removed the function declarations)
EDIT EDIT EDIT: I'm an idiot for not realizing that Delphi imports C++ types… REMAKE TIME!
EDIT EDIT EDIT EDIT: Well, actually….
mastaraymond
2007-12-02 17:53:58
From: R0b0t1
I know all of what you just said. (EDIT: Actually, not the stuff in the Graphics and Windows unit :rolleyes:)
But if you would have actually looked at the C++ documentation or the VC++ codehints, you would know that you do not need an RGBQUAD array… Its actually a LPVOID, or a typeless pointer. You can put any shit you want in it, as long as it makes since to the computer. If you specify a array of dwords/ints/bools/strings, it will fill that array with the numerical (in the case of a string, something else…) values for the colors.
:p
EDIT EDIT: Thanks, it works now. Mwuhahahahaha! (I just removed the function declarations)
Ofcourse it will fill anything, it fills at the Pointer.. If you put in a byte it will fill that.. But it does overwrite stuff in memory if your value hasn't allocated enough memory..
Btw, does GetDiBits pad the lines like Scanlines?
R0b0t1
2007-12-02 18:05:53
I really don't know what you mean by padding, but even if the array is bigger than the pictures info, it will stretch it. <- That It?
EDIT: Funny thing, but the type you told me to use doesn't work…
mastaraymond
2007-12-02 18:14:34
From: R0b0t1
I really don't know what you mean by padding, but even if the array is bigger than the pictures info, it will stretch it. <- That It?
No not exactly, on a scanline there is some padding at the end of each line.. Im not sure why, it just is.. I was wondering if the same goes for DiBits..
R0b0t1
2007-12-02 18:25:18
Oh. I'll check really quick, but I'm really sure it doesn't.