none
EditCopyPicture problem - MSPrj 2010 Pro RRS feed

  • Question

  • I am attempting to scale a Gantt gif using EditCopyPicture with ratio ScaleOption . The statement I'm using is


    .EditCopyPicture Object:=False, ForPrinter:=2, _
     SelectedRows:=True, FromDate:=StartGantt, ToDate:=EndGantt, _
     FileName:=OutputFileName, ScaleOption:=pjCopyPictureScaleWRatio, _
     MaxImageWidth:=8, MeasurementUnits:=pjInches

    This generates a gif, but does not scale it - it remains at the native size. Does anybody have any suggestions?


    Dave

    Friday, December 13, 2013 2:02 PM

All replies

  • Hi,

    When reading this from the help:

    ScaleOption

    Optional

    Long

    Specifies how to treat a picture of the active view if it is larger than MaxImageWidth by MaxImageHeight (default 22 inches by 22 inches). The default value is pjCopyPictureKeepRange. Can be one of the PjCopyPictureScaleOption constants.

    I wonder whether the picture of your active view is larger than 22 inches?

    Friday, December 13, 2013 8:35 PM
    Moderator
  • I saw that in the help, but that doesn't seem to be the case. I tried widths from very narrow (6 inches) to fairly wide (18 inches) and the gifs generated at native size and scaled size are identical. Very puzzling...

    Dave

    Friday, December 13, 2013 8:56 PM
  • I also tried the pjCopyPictureTimescale option, which is supposed to zoom the timescale to fit the MaxImageWidth, but it truncated the timescale instead of shrinking it.

    Dave

    Friday, December 13, 2013 9:02 PM
  • I just noticed this in the help:

    Contains constants that specify how to treat a picture of the active view if it is larger than MaxImageWidth by MaxImageHeight.

    My images do not exceed the max of 22 X 22, so apparently the Scale option does not apply.

    Here's my requirement: As part of an automated process that runs daily, I need to produce a large number of Gantt gifs in two different sizes - one native size to fit on a PowerPoint slide, and a narrower one to fit on a web page without horizontal scrolling. I could create a second view for each that uses smaller fonts and a shorter timeline, but that would double the labor required to maintain the Gantts, the main issue being symbol label placement to avoid overlap. I have also considered using a third part tool, such as Microsoft WIA or ImageMagick, to copy and resize the gifs after they are generated, but that raises a bunch of other issues.

    Can you suggest a solution that could work inside Project?

    Thanks


    Dave

    Friday, December 13, 2013 9:19 PM
  • Bit hard to recommend without seeing more exaclty what you want. Me personally, I would record macros of you manually producing what you want.

    Make sure you set up Views and tables only used by the macro so they work more reliably.


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Saturday, December 14, 2013 7:47 AM
    Moderator
  • My aim is to produce two gifs for each of my views, one 40% smaller than the other. I was hoping to be able to do this using Project vba methods, but evidently the scaling options for EditCopyPicture do not apply to gifs that are natively smaller than MaxImageHeight/MaxImageWidth. I'm now exploring ImageMagick and Microsoft WIA for making the 60% scaled copy after Project generates the full scale gif. ImageMagick is looking like the winner - it's simple, fast, and effective.

    Dave




    • Edited by dg_moore Saturday, December 14, 2013 11:05 PM
    Saturday, December 14, 2013 9:14 PM