Click here to Skip to main content
15,918,808 members
Home / Discussions / C#
   

C#

 
GeneralIAsync Pin
sreejith ss nair11-May-04 19:31
sreejith ss nair11-May-04 19:31 
GeneralRe: IAsync Pin
Dave Kreskowiak12-May-04 2:57
mveDave Kreskowiak12-May-04 2:57 
Generaldetect a new record entered/updated in MS SQL Pin
Vu Truong11-May-04 17:10
Vu Truong11-May-04 17:10 
GeneralRe: detect a new record entered/updated in MS SQL Pin
Aryadip11-May-04 17:41
Aryadip11-May-04 17:41 
GeneralRe: detect a new record entered/updated in MS SQL Pin
Mazdak11-May-04 20:06
Mazdak11-May-04 20:06 
Questionwhat is the problem with this GetDIBits invoke? Pin
fu011-May-04 16:42
fu011-May-04 16:42 
AnswerRe: what is the problem with this GetDIBits invoke? Pin
Christian Graus11-May-04 18:21
protectorChristian Graus11-May-04 18:21 
AnswerRe: what is the problem with this GetDIBits invoke? Pin
Roman Rodov11-May-04 19:07
Roman Rodov11-May-04 19:07 
Try declaring your structs like below or even better use a managed equivalent of GetDIBits, which is Bitmap.LockBits
<code>
IntPtr hBitmap = CreateCompatibleBitmap(hScreen, 800, 600);
Bitmap bitmap = Bitmap.FromHbitmap(hBitmap);
BitmapData bData = bitmap.LockBits(new Rectangle(0,0,bitmap.Width,bitmap.Height), ImageLockMode.ReadWrite, bitmap.PixelFormat);


or as I said above try to declare your structs like this if you absolutely must stick to GetDIBits
[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFOHEADER
{
 public uint biSize; // DWORD
 public long biWidth; // LONG
 public long biHeight; //LONG
 public uint biPlanes; // WORD 
 public uint biBitCount; // WORD
 public uint biCompression; // DWORD
 public uint biSizeImage; // DWORD
 public long biXPelsPerMeter; // LONG
 public long biYPelsPerMeter; // LONG
 public uint biClrUsed; // DWORD
 public uint biClrImportant; // DWORD
 public BITMAPINFOHEADER()
 {
   biSize = Marshal.SizeOf(this);
 }
}
 
[StructLayout(LayoutKind.Sequential)]
public class RGBQUAD 
{
 public byte rgbBlue; 
 public byte rgbGreen; 
 public byte rgbRed; 
 public byte rgbReserved; 
}

[StructLayout(LayoutKind.Sequential)]
public class BITMAPINFO 
{ 
 public BITMAPINFOHEADER bmiHeader; 
 public RGBQUAD [] bmiColors; 
 public BITMAPINFO()
 {
  bmiHeader = new BITMAPINFOHEADER();
  bmiColors = new RGBQUAD[1];
 }
}

AnswerRe: what is the problem with this GetDIBits invoke? Pin
fu012-May-04 0:14
fu012-May-04 0:14 
GeneralRe: what is the problem with this GetDIBits invoke? Pin
Heath Stewart12-May-04 3:03
protectorHeath Stewart12-May-04 3:03 
GeneralRe: what is the problem with this GetDIBits invoke? Pin
RobbKirk13-Jul-11 10:27
RobbKirk13-Jul-11 10:27 
GeneralInitial Positioning Pin
Wackatronic11-May-04 15:24
Wackatronic11-May-04 15:24 
GeneralRe: Initial Positioning Pin
Heath Stewart11-May-04 16:30
protectorHeath Stewart11-May-04 16:30 
GeneralRe: Initial Positioning Pin
Wackatronic12-May-04 7:09
Wackatronic12-May-04 7:09 
GeneralRe: Initial Positioning Pin
Meysam Mahfouzi11-May-04 16:34
Meysam Mahfouzi11-May-04 16:34 
GeneralNeed Help to link Nero Solution with C# Pin
GegoTheWizard11-May-04 12:49
GegoTheWizard11-May-04 12:49 
GeneralRe: Need Help to link Nero Solution with C# Pin
Heath Stewart11-May-04 16:25
protectorHeath Stewart11-May-04 16:25 
GeneralRe: Need Help to link Nero Solution with C# Pin
GegoTheWizard12-May-04 12:54
GegoTheWizard12-May-04 12:54 
GeneralRe: Need Help to link Nero Solution with C# Pin
Heath Stewart12-May-04 12:56
protectorHeath Stewart12-May-04 12:56 
GeneralCustomizing Windows Form - IE capabilities. Pin
stan2811-May-04 10:17
stan2811-May-04 10:17 
GeneralRe: Customizing Windows Form - IE capabilities. Pin
Heath Stewart11-May-04 11:01
protectorHeath Stewart11-May-04 11:01 
Generalserialization Pin
cristina_tudor11-May-04 10:15
cristina_tudor11-May-04 10:15 
GeneralRe: serialization Pin
Heath Stewart11-May-04 11:04
protectorHeath Stewart11-May-04 11:04 
GeneralQuery, DateTime Pin
DougW4811-May-04 10:15
DougW4811-May-04 10:15 
GeneralRe: Query, DateTime Pin
Michael P Butler11-May-04 10:25
Michael P Butler11-May-04 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.