Scaling with scale9Grid

scaling with scale9Grid
Hey guys,
I'm having more of a math problem than an AS problem ...
I have a moiveclip which contains a movie clip of a rectangle picture frame image which is scale9grid enabled (i have the grid staring at the inner corners) and the other a clip that will contain a loaded jpeg image.
Now the jpeg image is going to be of varying sizes (portrait/ landscape) and on top of that I'm going to be reducing the size a bit...probably about at a 200px width in proportion.
My problem is having to scale the scale9grid proportionally in ratio to the image's new size.
My first issue is whether or not i should use the scaleX =.5 (so much easy) or scale the width = width/2; the second is doing the conversion...
can someone get me started with an explanation?
my maths is no good...

WEll I think I did...hopefully...this is what I did
var w = (300 / image.width)*100;
            image.scaleX = w/ 100;
            image.scaleY = w/ 100;
            pictureBorder.scaleX = pictureBorder.scaleY = 1;
            var sw = (image.width / (pictureBorder.width - 23))*100;
            var sh = (image.height / (pictureBorder.height + 23))*100;
            var g = (pictureBorder.width - 23)/ 100;
            var g2 = (pictureBorder.height - 23)/ 100;
            //pictureBorder.width = image.width + 44;
            //pictureBorder.height = image.height + 22;
            pictureBorder.scaleX = 1;
            pictureBorder.scaleY = 1;
            pictureBorder.scaleX = sw/ 100 + g/100;
            pictureBorder.scaleY = sh/ 100 + g2/100;
            maskMc.width = pictureBorder.width;
            maskMc.height = pictureBorder.height - 23;
Its still a bit off and I'm not sure why
this is and image of the picture frame...i put the slicing at the outer corner edges where they intersect rather than on the inner rectangle where the picture would be....
Its the closest I got

Similar Messages

  • Ghosting occurs in shape tweens in clips with scale9Grid active.

    Why does ghosting occur in shape tweens?  Is this some kind of rendering bug?  I seem to keep running into stuff like this
    (sorry, first post had image that was not cropped properly by MSPaint and had tons of white space; I fixed it)
    --Background (feel free to skip if TL;DR): My SkinnedButton class supports states for DEFAULT, ROLLOUT, ROLLOVER, PRESS, RELEASE, RELEASEOUTSIDE, TRACKOVER, TRACKOUT, DRAGOVER, DRAGOUT, DRAGDROP, plus all variations of SELECTED_* states in addition to a "selectedMask" and "focusMask" display objects that are automatically arranged, docked, and made visible to suit not only the button state, but also (at least in the case of "focusMask") taking into account the manor in which it entered a particular state (via keyboard, via mouse, via assignment, what the drag source origin was, exact origin clip, custom tracked drag source, whether a drag even began, was cancelled, etc.).  It dispatches events for all of these states and has fallback chains for any that are missing, since they're all classified into simple states out, over, and down.  For example, if no RELEASE state is defined (can be either property named "mc_release" or "release" label on "skin" MovieClip), then it will progressively fall back to ROLLOVER, ROLLOUT, and finally DEFAULT until one is defined.  The bare minimum for a functional button is to define a clip for the default state.
    So anyway, I wanted to animate my "release" state by having the button collapse and expand, and I discovered this odd ghosting behavior.  This is just a simple reproduction of the problem with no special logic, just a shape tween on a clip with scale9Grid active.  It appears as though Flash isn't re-rendering the bottom most shape as its exposed by the tweened shape on the layer above:ShapeTweenGhosting.fla - Google Drive
    I suspect this is occurring because of the active scale9Grid, since the ghosting goes away when you turn it off, but then the button is all distorted.  Turning on cacheAsBitmap exhibits the same behavior.  Again, it's not a performance issue, it's just incorrectly rendering.  I don't see any documentation stating shape-tween animations are not allowed in clips with scale9Grid applied.  The shapes themselves appear to be rendering correctly based on the scale9Grid (i.e. without distortion), but the ghosting is a problem.
    Here is an even more pronounced example with a large shrinking and expanding oval shape:
    ShapeTweenGhosting2.fla - Google Drive

    I posted a bug here: Bug#3767678 - Ghosting occurs in shape tweens in clips with scale9Grid active
    Continued experimentation revealed it occurs on the y axis too, and depends on how much you scale the clip.
    At 99%, 100%, and 101%, no ghosting is observed.  At 110%, it occurs a little bit.  At 120%, the ghosting is very pronounced.  I suspect the problem is arising due to inaccurate calculations of the redraw regions, which may not be taking into account certain scaling factors, perhaps such as stroke widths; however, I reduced all stroke widths to zero (hairline), and the ghosting still occurred, so something is not quite right.

  • Exporting to PNG, Stroke Weight not Scaling with Export Scale

    Hi there
    I am having some issues exporting illustrator documents to multiple sizes of PNG.
    I am actually scripting this, but the issue seems to be more general - hence the posting here.
    If you export a PNG through the web and devices tool:
    File->Save for Web & Devices
    And you scale the image by 50%, the line weight does not seem to be scaled with the export scale.
    In Illustrator->Preferences->General I have Scale Strokes and Effects ticked.
    This problem is also apparent when scaling a scripted PNG export through the ExportOptionsPNG24 class.
    Is there anything I am missing please - or does anyone know of workarounds?
    Thank you

    Thanks for looking into it Kurt.
    I can't post the illustrator file in question to the forum.
    And, you are right, when I aim to make a demo file from scratch I can't reproduce the problem either.
    I am having this difficulty on multiple files though, and they are all quite complex.
    I will aim to try and make a file that shows the problem.
    The files in question may have symbols that were created in much earlier versions of Illustrator.
    I'm not sure if that could do it.
    The sequence above shows the output as I export via script to successively smaller scales.
    This is by setting the horizontalScale and verticalScale in ExportOptionsPNG24.
    I see the same results if scaling in Save for Web & Devices.

  • Flex Mobile project scaling with Retina display iPad (3rd gen).

    Adobe et al,
    With the new iPad 3 we now have a ton more pixels to utilize. I'm familiar with and have already successfully tested the AIR 3.1+ commandline compiler option (-platformsdk) to get Retina display on the new iPad. In ActionScript mobile projects the content is rendered beautifully on the new iPad. But with Flex Mobile projects, something is happening that causes it to render incorrectly. It's retina display alright, but the size is way too small.
    Below is an image WITHOUT the -platformsdk build tag, that causes the app to be pixel doubled to fit on the new iPad:
    Notice that it's scaled proportionally, even though the text and components are slightly pixelated. Not a big deal, but noticeable on the device.
    This image is taken with the app rendering in Retina display (setting the -platformsdk pointing to iOS 5.1 SDK):
    As you can see, the text/components are rendered really clear, but the scale is way off. Obviously it's getting the width of 2048x1536 from the device, but it's way too small.
    How do I fix this? I've tried changing the applicationDPI, but it doesn't fix it. Setting a width/height of 1024x768 does nothing either. It seems we need to overrride a behavior that causes it to fit everything in so small.
    A little help?
    Thanks,
    iBrent

    Alright, kevinkorngut's answer was the right one. It appears that even though AIR 3.x can render high resolution apps, it still returns the incorrect DPI for the new iPad. In a Flex Mobile project you have to override the DPI using the method mentioned above.
    Here are the results I got:
    Using the runtimeDPIProvider property on the TabViewApplication tag (works for any of the three project types) I created a class that extends RuntimeDPIProvider. To detect which iPad I was on, I used the following code:
    override public function get runtimeDPI():Number
         var os:String = Capabilities.os;
         if(os.indexOf("iPad") != -1)
              if(Capabilities.screenResolutionX > 2000 || Capabilities.screenResolutionY > 2000)
                   return DPIClassification.DPI_320;
              } else {
                   return DPIClassification.DPI_160;
         } else {
              return Capabilities.screenDPI;
    I'm returning a DPI of 320 as this gives the best result that matches the proportions of the device. In other words, even though the iPad DPI is 264, setting the app to 320 gives the correct size at the new Retina display.
    In order for this to work, you must compile the app with the -platformsdk flag pointing to iOS 5.1 SDK, and currently that means you need a Mac running Lion with Xcode 4.3.1. Here's the adt command I used:
    adt -package -target ipa-test -storetype pkcs12 -keystore ~/Desktop/iOS_DevCert.p12 -provisioning-profile ~/Desktop/iOS_DevProfile.mobileprovision newiPadTest.ipa newiPadTest-app.xml newiPadTest.swf -platformsdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPh oneOS5.1.sdk
    Also, the -app.xml descriptor file must have the <requestedDisplayResolution>high</requestedDisplayResolution> within the <iPhone> tags.
    Thanks everyone for their replies!
    iBrent

  • InDesign Cs4 Bleed/Slug not scaling with reduced print?

    Maybe I'm crazy, but I feel certain that when I've printed my layouts in the past, Indesign scaled the bleed and slug along with the rest of the page when I printed at a reduced size.
    Today, I can't get the bleed or the slug to output in relative scale to the document. i.e. a 20" x 32" poster with 1/8" bleeds and a 2 inch slug on top is being printed at 50%. In the Print preview box, it shows that while the page is being reduced properly to 10" x 16", the bleed is still 1/8" and the slug is still 2 inches, not 1/16" and 1" as I would have expected.
    o

    Sorry, miskeyed and hit the return key before I finished my thoughts:
    Am I wrong in thinking that InDesign usually scales bleed and slug with the page? Am I mis-remembering?
    If not, what is causing the odd non-scaling of bleed and slug?
    Mac OS 10.5.8
    Creative Suite 4
    InDesign v6.0.6

  • No scaling with mercury engine (Cinemascope to HD for playback)

    Hi
    I have a Blackmagic Extreme 3D+ card installed in my 12-core Mac Pro running AE CC 2014.
    When I playback an HD composition (1920x1080) the video is playback through the mercury engine fine.
    But when I have a cinemascope composition (2048x858) the video is not played back because it does not fit the aspect ratio I assume.
    When I playback the same resolution and aspect ratio e.g. in DaVinci Resolve the video is scaled and played back as a correct Letterbox through the same card.
    Of course I can set my AE comp to HD or nest my comp into a new HD comp but it would be great if it would play out directly doing the scaling.
    Is there a way to achieve this scaled playback or is Adobe doing something about it?
    I think this would be very important.
    Regards,
    Uli

    Hi
    Finally Blackmagic updated their Desktop Video Software to make it "customizable" in AE 2014.
    Well the setup dialogue in AE video preferences gives three options:
    No output: which means "off"
    center: which cuts off the picture if you are working with material wider than HD (like Scope, or everything that needs to be letterboxed)
    scale to fit: which distorts the picture awfully because it fits everything into a wrong aspect ratio
    What we would need is just what is in AE:
    Like "fit to width" which would maintain the right aspect ratio and scale a scope into HD.
    This should be possible I think. Otherwise nesting into a HD sequence is the only way again.
    (DaVinci does it, easydcp does it, all with the same BM card)
    Regards,
    Uli

  • Proportional Scaling with bounding box does not work

    Problem:
    When I attempt to proportionately scale  objects with the bounding box, by selecting a corner / handle and  holding Shift as I drag, it doesn't work.
    I'm not doing it wrong  or in the wrong order of selection, etc., I've done it this way for  years.
    Also, Illustrator is persnickity. It HAS  occasionally worked, but more often does not.
    Restarting  Illustrator, my computer, closing Entourage, nothing works.
    I read this thread and none of the suggestions work.
    http://forums.adobe.com/message/1258725#1258725
    Just for reference, these are the instructions from Illustrator manual that I am having issues with.
    Scale objects with the bounding box
    Select one or more objects.
    Select the Selection tool or the Free  Transform tool .
    Drag a bounding box handle until the object  is the desired size.Objects scale relative to the opposite  handle of the bounding box.
    Do any of the following to control the   scaling behavior:
    To maintain the object’s proportions, hold down Shift as you drag.
    To scale relative to the object’s center point, hold down Alt (Windows) or Option (Mac OS) as you drag.

    ask,
    You can see an updated list of applications reported in this forum to interfere with Illy here (item 7):
    Other options
    I am afraid there is not much to do, apart from disabling whatever causes the trouble. There have been quite a few threads about this recently.

  • No scaling with fullscreen flash playback

    Greetings,
    I have this problem where flash doesnt scale the video when I try to run it in fullscreen. Instead it centers the video on the middle of the screen, keeping the original size, with the rest of the screen becoming black. See the attached image.
    I'm running Firefox 6.02, NVIDIA 280.13 and Adobe Flash 11.0.1.129 (Flash 11 RC), all of them are x86_64 versions, running on KDE4. I have tried to disable hardware accelleration in flash (rightclick video->settings->uncheck enable hardware acceleration). I have also tried to disable "Force Full GPU Scaling" in nvidia-settings, along with trying the various GPU scaling methods. None of these tweaks have affected the way the video is displayed. Does anyone have any suggestions?
    Click for screenshot
    Last edited by wims (2011-09-14 05:43:56)

    So the problem seems to lie on youtube flash player with linux flashplugin.
    Not really a solution,
    but for firefox users, FlashVideoReplacer extension works flawlessly in youtube apart from losing ads ( ) and subtitles.
    I'm using it with gecko-mediaplayer and mplayer, my notebook battery is still saying "thank you!"
    Last edited by kokoko3k (2011-11-03 11:06:54)

  • Forum for handling high DPI scaling with MFC dlls

    Hi, 
    I have posted a related query on forum Windows Desktop Development forums > Application Compatibility for Windows Desktop Development.
    But have not got any replies yet. Please help. 
    Here is a link to my query: http://social.msdn.microsoft.com/Forums/en-US/c1d36a88-2dbb-4669-b0d4-d553f6fe63a5/scaling-dialogs-and-property-pages-in-a-mfc-application-to-render-correctly-on-high-dpi-devices?forum=windowscompatibility
    Thanks
    Parul Gupta

    Might also try here.
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages&filter=alltypes&sort=lastpostdesc
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How do you stop published animation speeds scaling with duration?

    I'm working on a title effect in Motion 5 for Final Cut Pro X 10.0.1.
    It's working very well - apart from the fact that if I change the duration of the Title, it changes the speed of movement of my text. This makes it difficult for users of the effect in Final Cut make the animation speed consistent between various instances of the title. It also means that if tech specs define specific speed in pixels per second, there's no way of setting such values in parameters published in Final Cut Pro X effects.
    It currently uses a Throw behaviour - I've published the Throw velocity.
    Does anyone know of a different behaviour or animation method that doesn't scale with the length of the generator. Ramp and Rate parameter behaviours don't work (they are time scaled). I can't use keyframes because they scale with time too.

    I fixed this by using adding a 'Project Loop End' marker to the end of the effect!
    I thought this sort of marker was only needed to prevent clips being time scaled...
    Alex

  • Images are no longer scaling with (img {max-width: 100%; }) in css as of update 34.0.5 in firefox, this still works great in IE and chrome.

    My website worked great until firefox update 34.0.5. Now the images will not scale to fit the box anymore. I am using flexbox so that the site scales to fit the size of the browser. In css I set img {max-width:100%;} and this would make the jpg files automatically size to fit the box they were in, but not anymore as Mozilla has really screwed this up with update 34.0.5. My site still works great with IE and Chrome but 70% of my web traffic is using firefox so I really would like this to work in firefox.
    Any help is greatly appreciated!

    I had the same problem, and this worked for me:
    img {max-width:100%; width:100%;}

  • Horizontal scaling, with large amounts of binary data

    question about horizontal scaling. tried asking late last night, but no one was active. Basically, I have an app that needs to scale (by adding new machines all talking to a database in the backend). This is all fine, but I have some binary file storage requirements for the app (files over 80 megs in size). This introduces a concurency issue, as I can't store this binary data on any of the individual server (because then it will be on one, and not all, leaving the app in an inconsistent state). So where do I store the data to enforce a consistent state? Have the individual apps FTP the file to a central location?
    I am trying to avoid storing binary data in the database; Does anyone have any suggestions on how to address this problem?

    I understand why you are trying to avoid storing binary data in a database but if you need to ensure that this data cannot be modified without the appropriate restrictions then using a database might make sense. You could even have a separate database just for the binary data because you will need to ensure you get the block sizing correct. Also, some databases might be better than others in this case. For example Oracle is likely to be significantly better than MySQL.
    If you do want to use files then you need to put the file in a central location and enforce locking the file to prevent concurrent modification. You can probably tie into a protocol that automatically handles this for you.

  • Is It Possible To Prevent a Stroke's Weight From Scaling with the Rest of an Object?

    I want to animate a person moving off into the distance, but while I want the size of the figure to get smaller, I don't want the weight of the lines that comprise the image to scale down, too. I made this little sample of a person skating (poorly) away from the viewer, and I'd like the line weight to be 9 points in the first frame and the last frame. Is there a setting that allows me to exclude stroke weight when scaling and resizing an object?

    If you're asking if you can scale the length of the stroke but not the width, I don't think you'll have much luck there... I'm pretty sure one follows the other.

  • Outlet Power Scaling with Compact Fieldpoint

    Does anyone have any suggestions on scaling outlet power?  I have a fan which takes 115 VAC and .68 A but the PWM module can't handle that wattage.   I've considered using an electronic potentiometer but have yet to find one which suppports my requirements.  It's for a fan which we need to scale between 0 and full speed.
    We have: 
    Compact Fieldpoint 2120
    cFP-AI-112 Aanalog input
    cFP-PWM-520  Pulse width modulation output
    cFP-TC-120  Thermocouple module 

    You may want to look for a small variable frequency drive.  Speed is varied by different frequency outputs.  You could control one by outputing an analog signal to it, or even using serial communication.

  • GTK font scaling with bitmap fonts

    I wish to use GohuFont, a bitmap font, for my GTK windows which has embedded 11pt and 14pt sizes. These usually work fine but in cases where applications attempt to draw fonts larger than 14pt it uses some TTF font instead. Is it possible to change the font that GTK defaults to to something different, e.g. GohuFont at 14pt, bold?
    The other solution I can think of would be to spoof larger fonts by just copying the file for the 14pt font and modifying its header to be read as 16pt or something; I've found programs to modify the characters themselves but not one that'll let me change what size the font is "read" as.
    Last edited by mot.def (2015-05-06 18:19:25)

    Nah. I doubt you've played hard enough with the multitude of settings that Infinality provides. I have heard your argument before, and it's *always* by people who show extremely little evidence of what they've actually tried, so it always seems to be laziness of the tweaker rather than something lacking in Infinality.
    E.g. just this one setting has a huge effect, with different values (it's a mirror-image, so has 3 values to tweak):
    export INFINALITY_FT_FILTER_PARAMS="14 20 32 20 14"
    If your eyes are giving you discomfort, then you really need to check with an optician, and/or get a better screen, purely for the sake of your health.

Maybe you are looking for

  • Windows 8.1 on HP Envy

    I just upgraded to Windows 8.1 and added all HP recommended updates and drivers.  Now there is no sound and an error message that the upgrade to the internal speakers is a problem.  What should I do? This question was solved. View Solution.

  • Statspack report analysis

    Hi, How should i analyze my statspack report. what are major attributes whihc i should concentrate more in analyzing the SP report. Thankx.....

  • How to capture the screen and send it to attachment for that mail

    hi sir ,      how to capture the screen shot and attach with that e-mail , whether it is possible or not .. Regards, kumar

  • Recover bookmarks

    I was having issues with my firefox (errors, crashes, freezing, etc) so I decided to do an uninstall then a reinstall to see if it would fix. But before doing this I had set up a firefox sync account, and i made it to sync all my bookmarks. Of course

  • How to Add meta tag in bsp

    hi experts, we have a bsp page,in which i need to declare meta tags,like in html. but though i delare it,while i debug the code,I can see its not  passing through the meta code. please advise me how to add a meta tag in bsp. <%@page language="abap" %