Click here to Skip to main content
15,889,877 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes20-Jan-10 10:09
professionalalleyes20-Jan-10 10:09 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery20-Jan-10 10:20
Mark Salsbery20-Jan-10 10:20 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes20-Jan-10 10:31
professionalalleyes20-Jan-10 10:31 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes20-Jan-10 10:45
professionalalleyes20-Jan-10 10:45 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery20-Jan-10 11:33
Mark Salsbery20-Jan-10 11:33 
GeneralRe: Saving Bitmap image data to HGLOBAL [modified] Pin
alleyes21-Jan-10 2:15
professionalalleyes21-Jan-10 2:15 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery21-Jan-10 5:19
Mark Salsbery21-Jan-10 5:19 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes21-Jan-10 5:33
professionalalleyes21-Jan-10 5:33 
Hi,

This is what I have so far:

MemoryStream^ ms = gcnew MemoryStream();
MyImage->Save(ms, System::Drawing::Imaging::ImageFormat::Bmp);
ms->Seek(0, SeekOrigin::Begin);

if (GlobalSize(MyGlobal) < ms->Length)
{
   GlobalReAlloc(MyGlobal, (LONG)ms->Length, 0);
}

void* pMyGlobal = (UCHAR*)MyGlobal;
UnmanagedMemoryStream^ ums = gcnew UnmanagedMemoryStream((UCHAR*)pMyGlobal, GlobalSize(MyGlobal), GlobalSize(MyGlobal), FileAccess::ReadWrite);
ums->Position = 0;
ms->WriteTo(ums);


It occurs on the line:

ms->WriteTo(ums);

This is even without setting the Position of the streams. I did this because just before the Call to WriteTo, the position was set to Length.
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery21-Jan-10 5:42
Mark Salsbery21-Jan-10 5:42 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes21-Jan-10 5:54
professionalalleyes21-Jan-10 5:54 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery21-Jan-10 6:05
Mark Salsbery21-Jan-10 6:05 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery21-Jan-10 6:19
Mark Salsbery21-Jan-10 6:19 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes21-Jan-10 9:20
professionalalleyes21-Jan-10 9:20 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes20-Jan-10 7:34
professionalalleyes20-Jan-10 7:34 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
Mark Salsbery20-Jan-10 7:40
Mark Salsbery20-Jan-10 7:40 
GeneralRe: Saving Bitmap image data to HGLOBAL Pin
alleyes20-Jan-10 7:51
professionalalleyes20-Jan-10 7:51 
QuestionFade TabPage between TabControl's tab selection Pin
roshihans15-Jan-10 19:02
roshihans15-Jan-10 19:02 
QuestionI need an ebay program Pin
totolcm13-Jan-10 2:22
totolcm13-Jan-10 2:22 
QuestionCreating image file from pointer to HGLOBAL Pin
alleyes10-Jan-10 12:28
professionalalleyes10-Jan-10 12:28 
AnswerRe: Creating image file from pointer to HGLOBAL Pin
Mark Salsbery12-Jan-10 9:59
Mark Salsbery12-Jan-10 9:59 
GeneralRe: Creating image file from pointer to HGLOBAL Pin
alleyes12-Jan-10 10:25
professionalalleyes12-Jan-10 10:25 
GeneralRe: Creating image file from pointer to HGLOBAL [modified] Pin
Mark Salsbery12-Jan-10 10:34
Mark Salsbery12-Jan-10 10:34 
GeneralRe: Creating image file from pointer to HGLOBAL Pin
alleyes12-Jan-10 10:52
professionalalleyes12-Jan-10 10:52 
GeneralRe: Creating image file from pointer to HGLOBAL Pin
alleyes20-Jan-10 3:02
professionalalleyes20-Jan-10 3:02 
GeneralRe: Creating image file from pointer to HGLOBAL Pin
Mouzam Basheer23-May-16 20:40
Mouzam Basheer23-May-16 20:40 

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.