I think you are talking about this: Class CBitmap has the method Save. It's overloaded in five constructors.For instance one of them get the parameters --- pBitmap::Save( System::String__gc , System::Drawing::Imaging::ImageFormat__gc) where in the string you put a name for saving the file ( actually you put whole path ), and in the second one you specify the requiered format that you want for this saved image. Yes it's so simple to save your new bitmap as Gif, Tiff, JPeg, Icon and so on. For instance you can use this function in this way: {.... System::String * mark = S"\\"; //We open an openFileDialog in our form, we suppose that are //filtered for only show BMP files. System::Windows::Forms::OpenFileDialog * openFileDialog1 = new System::Windows::Forms::OpenFileDialog(); openFileDialog1->ShowDialog(); //We get the selected file path String* strResult = openFileDialog1->FileName; System::Drawing::Bitmap * pBitmap; //and open it in our Bitmap pBitmap = new System::Drawing::Bitmap( strResult); //We search the last '\' in the path for change the name of the file and // the extension int Index = strResult->LastIndexOf (mark); strResult = strResult->Substring(0,Index); strResult = strResult->Concat(strResult,S"\\ITS_OK.jpg" ); //finally you can save it with your new desired format (or the same one) pBitmap->Save(strResult, System::Drawing::Imaging::ImageFormat::Jpeg ); } if your question is in another way, please reply me. Best Regards!:-D
RafMar
Posts
-
how i save bitmap file by use VC++ .net -
About Get Data from ClipboardOK, thanks for reply, there was only an exemple. You are right, but if you proove the code with the correct order ( as you very well are saying ), you will see that doesn't work well ( The object 'obj' doesn't keep the data..). I have read in Microsoft support that there is a debug in this cases that imposibility the correct retriving some kind of Data from Clipboard, as Metafiles ( I hope that the next version of .NET will correct this cuestion.) Thank you very much Arlen :)
-
About Get Data from ClipboardI know that I have Data in the clipboard with the DataFormat.MetafilePict. But I can't get it. My code is more or less the next: ///////////////////////////////////////////////////////////// IDataObject iData = Clipboard.GetDataObject(); if ( iData.GetDataPresent( DataFormats.MetafilePict) ) { System.Object obj; System.Drawing.Imaging.Metafile pMetafile; obj = Clipboard.GetDataObject()>GetData(System.Windows.Forms.DataFormats.MetafilePict ); } ///////////////////////////////////////////////////////// Obviusly in the Debug, I enter inside the first if condition, so the code executes but the System::Object obj can't keep the data of clipboard and keeps a undefined value after the asignation. It seems a contradiction, isn't it ? :confused: Can anybody say me anything about get MetafilePict Data from Clipboard ? Advanced Thanks, everybody.;)
-
About Get Data from ClipboardI know that I have Data in the clipboard with the DataFormat.MetafilePict. But I can't get it. My code is more or less the next: ///////////////////////////////////////////////////////////// IDataObject iData = Clipboard.GetDataObject(); if ( iData.GetDataPresent( DataFormats.MetafilePict) ) { System.Object obj; System.Drawing.Imaging.Metafile pMetafile; obj = Clipboard.GetDataObject()>GetData(System.Windows.Forms.DataFormats.MetafilePict ); } ///////////////////////////////////////////////////////// Obviusly in the Debug, I enter inside the first if condition, so the code executes but the System::Object obj can't keep the data of clipboard and keeps a undefined value after the asignation. It seems a contradiction, isn't it ? :confused: Can anybody say me anything about get MetafilePict Data from Clipboard ? Advanced Thanks, everybody.;)
-
About Get Data from ClipboardI know that I have Data in the clipboard with the DataFormat::MetafilePict. But I can't get it. My code is more or less the next: ///////////////////////////////////////////////////////////// if ( iData->GetDataPresent( DataFormats::MetafilePict) ) { System::Object * obj; System::Drawing::Imaging::Metafile * pMetafile; obj = Clipboard::GetDataObject()>GetData(System::Windows::Forms::DataFormats::MetafilePict ); pMetafile = dynamic_cast< System::Drawing::Imaging::Metafile * > (obj); } ///////////////////////////////////////////////////////// Obviusly in the Debug, I enter inside the first if condition, so the code executes but the System::Object obj can't keep the data of clipboard and keeps a undefined value after the asignation. It seems a contradiction, isn't it ? :confused: Can anybody say me anything about get MetafilePict Data from Clipboard ? Advanced Thanks, everybody.;)
-
Use MessageBox in Windows FormsThank you Tom. It's OK ::-D
-
Use MessageBox in Windows FormsI heard that the compiler is confussed whith the use of MessageBox in Windows::Forms. Can anybody tell me what is the correct precompiler directive for the correct use of MessageBox Class in Windows::Forms??? THANK YOU, VERY MUCH
-
Problems with splitters in Windows FormsI have some problems whith the splitters. In design time it's O.K. But the problems start at run time, when I create some child Forms by code and I try to dock them inside a new splitter but it's impossible, the splitter ignores the correct order (it´ss been generated later than the Form child) and does not include the new child form inside. It's like the Form child is not treated like another design control inside the main Form. Please, can anybody help me about the treatment and placement of splitters controls in run time with Windows Forms? Thank you. Raf.