User Tag List

Results 1 to 4 of 4

Thread: MMF2 Extension Kit Help CHM

  1. #1
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MMF2 Extension Kit Help CHM

    I want to export some graphics file (BMP) using MMF2 filters but this chapter in the CHM Help has not been writed... Is it possible to have a new version of this help file with it ? And/Or is it possible to help me about that ?

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)

    Re: MMF2 Extension Kit Help CHM

    Hmm... there is an Exporting Graphic Files section in the SDK help file. If it's not in your version, redownload the SDK.

    There is no Export example though, here is one. Note: I didn't try to compile this code, hopefully it works - let me know if there are any error.

    Code:
    // Export a surface as image file
    //
    // Note: fileName is overwritten by this function, it should contain at least MAX_PATH characters)
    //
    void ExportBitmapFile(LPRH rhPtr, LPSURFACE psf, LPSTR fileName)
    {
    	DWORD dwFilterID = 0;
    	CImageFilterMgr pMgr = rhPtr->rh4.rh4Mv->mvImgFilterMgr;
    	OPENFILENAME	ofn;
    	char szFileName[_MAX_PATH];
    	char szFileTitle[_MAX_PATH];
    
    	memset((LPVOID)&ofn, 0, sizeof(OPENFILENAME));
    	ofn.lStructSize = sizeof(OPENFILENAME);
    	szFileName[0] = 0;
    	szFileTitle[0] = 0;
    
    	ofn.hwndOwner = rhPtr->rhHMainWin;
    	ofn.lpstrFile = szFileName;
    	ofn.nMaxFile = sizeof(szFileName);
    	ofn.nFilterIndex = 1;
    	ofn.lpstrFileTitle = (LPTSTR)szFileTitle;
    	ofn.nMaxFileTitle = sizeof(szFileTitle);
    	ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_NOCHANGEDIR;
    
    	// setup initial file name
    	strcpy(szFileName, (LPCSTR)fileName);
    
    	// Open selector and choose picture filename and format
    	if ( ChoosePicture(&ofn, FALSE, pMgr, &dwFilterID, PICSEL_IMAGES) )
    	{
    		// Return filename
    		fileName = ofn.lpstrFile;
    
    		// Export image
    		if ( !ExportImage(pMgr, fileName, psf, dwFilterID) )
    		{
    			// Error
    		}
    	}
    }
    PS: if you want to force the filter ID (= file format) and/or don't want a file selector, remove the call to ChoosePicture and use one of the predefined filters ID's (FILTERID_BMP, FILTERID_PNG, FILTERID_JPEG).

  3. #3
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF2 Extension Kit Help CHM

    Thanks Yves, I'll redownload my SDK because this chapter is white.

    Actually I have a HBITMAP, How can I convert it into LPSURFACE ?

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,022
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)

    Re: MMF2 Extension Kit Help CHM

    Ah, HBITMAP... can't you use / get a DIB instead of a HBITMAP? It's much easier to work with DIBs (and then load a DIB into a surface with the LoadImage function). Otherwise you can convert a HBITMAP to a DIB via a memory DC, I can explain it to you if you need it.

Similar Threads

  1. VB.Net extension and MMF2
    By daniele in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 6th August 2013, 09:01 AM
  2. MMF2 Extension Request : OE-Cake Fluid extension
    By pyromane in forum Extension Development
    Replies: 5
    Last Post: 1st July 2013, 03:51 AM
  3. MMF2 Extension Pack #1
    By Yves in forum Extension Developers Lobby
    Replies: 3
    Last Post: 11th July 2006, 05:08 PM
  4. MMF 1.5 extension on MMF2
    By MechatheSlag in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 1st July 2006, 02:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •