Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    ScaleIt returns all black

    SDK Help
    0
    3
    288
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 28/04/2016 at 03:10, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   15 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      I am trying to convert a 32 bits file with resolution 4000x2000 to a 8 bits file with resolution 1200x600.
      It always returns a file with black contents.
      The input file is correct. I see it correctly in the preview window.

      	AutoAlloc<BaseBitmap> outFile;
      	outFile->Init(4000,2000, 24);
        
      	.... outFile is created
        
      	AutoAlloc<BaseBitmap> demoFile;
      	demoFile->Init(1200, 600, 8);
        
      	outFile->ScaleIt(demoFile, 256, true, false);
        
      	res = demoFile->Save(demoLocation, FILTER_JPG, nullptr, SAVEBIT_0);
      	if (res != IMAGERESULT_OK)
      		GePrint("Error saving DEMO file: " + demoLocation.GetString());
        
      
      
      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 28/04/2016 at 06:19, xxxxxxxx wrote:

        Hi Pim,

        INITBITMAPFLAGS_GRAYSCALE has to be passed to Init() (4th argument INITBITMAPFLAGSflags) for 8 bits bitmaps.

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 28/04/2016 at 12:28, xxxxxxxx wrote:

          Thanks Yannick, I will give a try and report back.

          Yes, it works. Thanks.

          -Pim

          1 Reply Last reply Reply Quote 0
          • First post
            Last post