Click here to Skip to main content
15,917,793 members
Home / Discussions / C#
   

C#

 
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 
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 
You realize there's much easier ways that don't require unmanaged functions? If you're using a TcpClient or some other connection, just get the NetworkStream and write your Bitmap to the stream. Simple. If you want to convert it first (a waste of time), then use either write to a memory stream and then send the bytes, or use the ImageConverter like so:
ImageConverter converter = TypeDescriptor.GetConverter(typeof(Image));
byte[] buffer = (byte[])converter.ConvertTo(image, typeof(byte[]));
You really should read the class library documentation in the .NET Framework SDK. There are plenty of ways to do this using only managed code, and a heck of a lot easier as well.

Even if you wanted to get the DIB bits, just use Bitmap.LockBits as someone else mentioned. There is absolutely no reason to P/Invoke unmanaged functions.

 

Microsoft MVP, Visual C#
My Articles
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 
GeneralRe: Query, DateTime Pin
DougW4811-May-04 13:16
DougW4811-May-04 13:16 
GeneralRe: Query, DateTime Pin
Heath Stewart11-May-04 11:07
protectorHeath Stewart11-May-04 11:07 

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.