|
-
Apr 19th, 2007, 05:44 PM
#1
Thread Starter
Fanatic Member
How to dereference a pointer as a structure
I've an IntPtr which points to the location where a Bitmap stores its raw image, i.e. not pointer to the bitmap object, but pointer to the image data itself (which I obtained through BitmapData.Scan0)
Now I've a structure like this
VBCode Code:
Structure RGB
B As Byte
G As Byte
R As Byte
End Structure
I need to be able to access the individual pixels (which I locate using the pointer) on the image as this RGB Structure.
In other words, it's like casting the pointer as a structure type. In C# it may be something like (RGB*) bmpptr;
Anyone know how?
Thanks in advance.
ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
Programming is fun, but only if you're not on a tight deadline 
So I consider all those working engineers sad people
VB FTP class
3 page PHP crash course
Crash Course on DX9 Managed with VB.NET covering basics till terrain creation
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|