Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How do you scale/zoom an Img?

    I seem to only be able to set the parameters of an Img when it is created,

    Code:
            var img = isc.Img.create({
                left:0, right:0,
                width: "100%",
                height:"100%",
                imageHeight: imageHeight,
                imageWidth: imageWidth,
                imageType: "center",
                overflow: "auto",
                border: "1px solid gray",
                src: record.front,
                shadowDepth: 10,
                showShadow: true,
                autoDraw: false
            });
    Then later, when the values have been changed for zoom in/out etc...

    Code:
        img.imageHeight = imageHeight;
        img.imageWidth = imageWidth;
        img.imageType = imageType;
        img.resetSrc();
    Does nothing. My shins are bloody from bumping into all this problems like this. Seems so simple, but isn't..... Frustrated to the point of finding another toolset.

    #2
    Be sure to make good use of the documentation. You will notice that every attribute has flags such as "IR" or "IRW" - click through for a summary of how to change properties after init.

    Comment


      #3
      Perhaps if there had been something that pointed me at those I might have noticed them.

      There is NO mention of them in the Quick Start guide, and quite frankly I had not noticed them AT ALL. And what does "Advanced" mean? There is no tool tip for it.

      All that being said, your answer doesn't really answer my question at all.

      I can call setImageType to adjust the ImageStyle, but without the ability to adjust imageHeight and imageWidth, I have no way to keep the scale of the document image after it is created. There has to be some kind of viewPort so that you can pan (my next problem) and zoom, and quite frankly I don't know where to look.

      It might help if "Show Superclass APIs" in the reference manual actually worked. If it was actually showing the superclass APIs, you might see things like setRect (which is in the Canvas, but does not show up on the Img or Stateful Canvas Instance APIs). But using setRect introduces some really strange behavior (see attachment) so maybe it is hidden for a reason?

      Brevity of answers might be great from your spiritual adviser, but from technical support it can be infuriatingly difficult to follow.


      Also, I would like to point out that the following documentation is not very helpful.
      Code:
      type ImageStyle
      
      Valid values:
      
      "center"	Center (and don't stretch at all) the image if smaller than its enclosing frame.CENTER:"center",
      "tile"	Tile (repeat) the image if smaller than its enclosing frame.
      "stretch"	Stretch the image to the size of its enclosing frame.
      "normal"	Allow the image to have natural size
      "normal" mode is what? How is it different from "center"? An example here could really help clear things up.

      And this is not a rhetorical rant, I'd really like to know how to do this.
      Attached Files

      Comment

      Working...
      X