|
-
Jul 19th, 2011, 05:45 PM
#7
Re: Convert VB6 Code to VB2010. Code from "The most amazing VB6 Code ever" thread
For all the code you need to adjust the types (as per Kev's BITMAPINFOHEADER)
Long --> Int32 or Integer
Integer --> Int16 or Short
You could avoid all the structures and the GDI API call altogether by using Bitmap.Lockbits() with an appropriate Bitmap (Format32bppRgb) and Marshal.Copy(). It looks like it is specifying a top down bitmap which I've not tried declaring yet in .Net, I would try passing a negative height parameter first.
Edit: had a play with top down bitmaps using C# and it is not so straight forward. I could only get it working by using the overload that accepts a pointer (so had to allocate or pin some memory for it).
Last edited by Milk; Jul 19th, 2011 at 07:47 PM.
W o t . S i g
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
|