Click here to Skip to main content
15,925,061 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralComplex data binding and ListView column sorting problem Pin
zinzinlabine7-Sep-03 6:18
zinzinlabine7-Sep-03 6:18 
GeneralReflection question Pin
Gluber20026-Sep-03 15:54
Gluber20026-Sep-03 15:54 
GeneralRe: Reflection question Pin
leppie7-Sep-03 4:08
leppie7-Sep-03 4:08 
GeneralSuspendLayout() doen't work on richTextBox Pin
eranas3-Sep-03 21:07
eranas3-Sep-03 21:07 
GeneralRe: SuspendLayout() doen't work on richTextBox Pin
leppie7-Sep-03 4:14
leppie7-Sep-03 4:14 
GeneralExposing properties (COM interop) Pin
Elbie2-Sep-03 5:31
Elbie2-Sep-03 5:31 
GeneralOverriding Paint message in TextEditBase or RichEditBox Pin
NormDroid2-Sep-03 4:46
professionalNormDroid2-Sep-03 4:46 
GeneralIPicture to System.Drawing.Image Pin
Corinna John2-Sep-03 3:37
Corinna John2-Sep-03 3:37 
Hallo *.*,

how do I convert IPicture to Image? I know there is a HANDLE field, but whenever I call Image.FromHbitmap(handle), it fails with an ExternalException in system.drawing.dll.

What am I doing wrong?

//get an IPicture of the visible MapPoint map
MapPointUtilities util = new MapPointUtilitiesClass();
Object obj = util.GetPictureFromObject(mapControl.ActiveMap, 100000, 100000);

//get the handle
Type t = obj.GetType();
Object handle = t.InvokeMember("HANDLE", BindingFlags.GetProperty, null, obj, null);

//convert the handle
Int32 intHandle = (Int32)handle;
IntPtr ptrHandle = new IntPtr(intHandle);

//get the image
Image img = Image.FromHbitmap(ptrHandle);
//does not work either
//Bitmap bmp = Bitmap.FromHbitmap(ptrHandle);

Image.FromHbitmap throws this exception:
System.Runtime.InteropServices.ExternalException' in system.drawing.dll
Additional Information: A general error has occurred in GDI+

Thanks for every hint,
Corinna
GeneralTimezones and Date formatting Pin
AJB...1-Sep-03 10:05
AJB...1-Sep-03 10:05 
GeneralRe: Custom Collection based on ... Pin
dog_spawn4-Sep-03 16:58
dog_spawn4-Sep-03 16:58 
General.net DataSet Relations Lost.... Pin
mgaerber27-Aug-03 4:44
mgaerber27-Aug-03 4:44 
Generallost? Pin
dog_spawn4-Sep-03 17:02
dog_spawn4-Sep-03 17:02 
GeneralRe: lost? Pin
mgaerber9-Sep-03 20:12
mgaerber9-Sep-03 20:12 
GeneralVARIANT* in COM Interop Pin
Elbie27-Aug-03 0:48
Elbie27-Aug-03 0:48 
GeneralRe: VARIANT* in COM Interop Pin
Elbie27-Aug-03 5:08
Elbie27-Aug-03 5:08 
GeneralRe: VARIANT* in COM Interop Pin
igor19603-Sep-03 10:28
igor19603-Sep-03 10:28 
General.NET component in MFC applicaiton Pin
Member 45183026-Aug-03 20:23
Member 45183026-Aug-03 20:23 
GeneralRe: .NET component in MFC applicaiton Pin
J. Dunlap26-Aug-03 21:23
J. Dunlap26-Aug-03 21:23 
GeneralRe: .NET component in MFC applicaiton Pin
Member 45183026-Aug-03 21:47
Member 45183026-Aug-03 21:47 
GeneralRe: .NET component in MFC applicaiton Pin
J. Dunlap26-Aug-03 21:54
J. Dunlap26-Aug-03 21:54 
GeneralRe: .NET component in MFC applicaiton Pin
Jerry Dennany3-Sep-03 14:45
Jerry Dennany3-Sep-03 14:45 
GeneralNumericUpDown Problem Pin
Gomac26-Aug-03 13:55
Gomac26-Aug-03 13:55 
GeneralRe: NumericUpDown Problem Pin
Gomac28-Aug-03 3:12
Gomac28-Aug-03 3:12 
General"The WSE must be installed to enable this feature" Pin
adaoja26-Aug-03 3:44
adaoja26-Aug-03 3:44 
QuestionHow to use tcpTrace? Pin
Anonymous25-Aug-03 8:28
Anonymous25-Aug-03 8:28 

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.