Results 1 to 2 of 2

Thread: Create Multipage Tiffs

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    67

    Create Multipage Tiffs

    I'm going nuts trying to create a multipage tiff from several pre-existing single page tiffs. I understand that i need to utilize bitmap.saveadd to make this work. Things just really aren't working out on all this for me. The encoderparamaters and such are driving me nuts. could anyone help? I just want to take 2 single page tiffs and save them as a single multipage tiff



    Thanks!

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    67
    Oh yeah theirs a beautiful MSDN example in c# but that doesnt help me one darn bit.. heres that example


    VOID Example_SaveAdd(HDC hdc)
    {
    Graphics graphics(hdc);
    EncoderParameters encoderParameters;
    ULONG parameterValue;
    GUID dimension = FrameDimensionPage;

    // An EncoderParameters object has an array of
    // EncoderParameter objects. In this case, there is only
    // one EncoderParameter object in the array.
    encoderParameters.Count = 1;

    // Initialize the one EncoderParameter object.
    encoderParameters.Parameter[0].Guid = EncoderSaveFlag;
    encoderParameters.Parameter[0].Type = EncoderParameterValueTypeLong;
    encoderParameters.Parameter[0].NumberOfValues = 1;
    encoderParameters.Parameter[0].Value = &parameterValue;

    // Get the CLSID of the TIFF encoder.
    CLSID encoderClsid;
    GetEncoderClsid(L"image/tiff", &encoderClsid);

    // Create an image object based on a TIFF file that has four frames.
    Image fourFrames(L"FourFrames.tif");

    // Save the second page (frame).
    parameterValue = EncoderValueMultiFrame;
    fourFrames.SelectActiveFrame(&dimension, 1);
    fourFrames.Save(L"TwoFrames.tif", &encoderClsid, &encoderParameters);

    // Save the fourth page (frame).
    parameterValue = EncoderValueFrameDimensionPage;
    fourFrames.SelectActiveFrame(&dimension, 3);
    fourFrames.SaveAdd(&encoderParameters);

    // Close the multiframe file.
    parameterValue = EncoderValueFlush;
    fourFrames.SaveAdd(&encoderParameters);

    // Draw the two frames of TwoFrames.tif.
    Image twoFrames(L"TwoFrames.tif");
    twoFrames.SelectActiveFrame(&dimension, 0);
    graphics.DrawImage(&twoFrames, 10, 10);
    twoFrames.SelectActiveFrame(&dimension, 1);
    graphics.DrawImage(&twoFrames, 150, 10);
    }
    Last edited by Iamthewalrus15; Mar 17th, 2003 at 09:07 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width