1 Reply Latest reply on Jan 22, 2007 3:10 AM by Hugo_Core

    Resize a inline image

      Im trying to make a application, that will load 2 images inline from a server.
      Does anyone have a demo, that explain how to make inline images resize properly and also how to make a dynamic resize using a HSlider.
      What really drives me crazy, is that I can't get the "original" size, so I can determine the resize rate.

      I've been trying to use a function that get's called on complete for the image, it will then set the width to the canvas width / 2. (there's a left and right page, that si's next to each other)
      It works fine, and they "fit to canvas" - but I cant determine what the original size is, have been looking at scaleX, but it always return 1 - even though I resized the image to maybe 60%.

      So... does anyone have a tutorial on how to resize images - have been searching the last couple of days.

      Thanks for any help you can provide.

        • 1. Resize a inline image
          Hugo_Core Level 1
          Hello oneproof,

          Have you consired the minWidth , minHeight, maxWidth and maxHeight syntaxes?

          Like img1.maxWidth = 500; img1.minWidth = 200; img1.width = 100%

          Try insert inside a VBox with per example vBox1.width = 60% , the image will occupy the
          entire box because we set width=100%, but the width can't be bigger then 500px because we set maxWidth=500.

          Hope I help something..
          Core , regards..