How do you size dynamically loaded images?

Hi,
I am loading images from mysql into flash using php, I need
to make thumbnails out of these images, so they need to be resized
as they are loaded in and then displayed to one set size. Does
anyone have any ideas?
thanks
Gavin

Jan-Paul K>
i thought it was _xscale & _yscale?
thahip>
if what you need is "one set size", then use _width &
_height.

Similar Messages

  • How to dynamically load images into Flash

    I have a movie clip on the stage that I want to dynamically
    load images into (that constantly change), how would I go about
    doing this? Thanks.

    Use the Loader class to load in images.
    Then use addChild to add the Loader class into your MovieClip
    on the stage.
    As far as "constantly change" what
    do you mean by that? You could use setInterval, ther enterFrame
    event, or any other means to trigger a new image to be loaded into
    the Loader instance.
    Finally, you can use the Tween class to create some nice
    effects for the images (fade it, blur in, photo blend, masks,
    etc)

  • Get width and height of a dynamically loaded image once it's done loading?!

    hello : :
    well... i'm taking my first shots at flex after programming
    in flash for a year now. it's been fun and i've been picking up on
    things pretty well (or so i think), but i come across something
    today that i used to be able to do in my as2 programming and don't
    know how to do in as3...
    in flex, i'm loading an image into an image control (by using
    "myImgControl.load(urlString)"). i have a "complete" parameter on
    the image control that calls a function just fine after the image
    is loaded, but if i try and check the hight and width of the loaded
    image once it loads, it comes back as zero. how can i get the
    height and width of the image after it's loaded?!
    in flash/as2 i used to do this little trick/work-around i
    found in a forum (kirupa.com, i think) to find out the width and
    height once the loaded image listener checked the loading process
    and came back "complete"... in the code below, "imgLoader" is the
    movieClip the image was loaded using
    imgLoaderListener.loadClip(urlString, imgLoader).
    quote:
    iTot = imgLoader.getBytesTotal();
    iLoad = imgLoader.getBytesLoaded();
    if (iLoad == iTot && iTot > 4) {
    imgH = imgLoader._height;
    imgW = imgLoader._width;
    that all make sense?!
    basically, it's as simple as this: i need to find something
    similar to the above for as3 that will tell me the width and height
    of a dynamically loaded image after it's done loading...
    so there ya have it. i appreciate any help any of you can
    throw my way! thank you so much for even reading this!
    : : michael

    I assume you have probably already figured this out, but just
    in case, there should be an event to listen for after which you can
    get the height and width information successfully. I can't remember
    the exact name, however. Experiment and see which one works
    time-wise.

  • Alpha transparency borders on dynamically loaded images for use with textures

    Hi there folks. Well, I have been beating my head over this
    and am hoping one of you can help me out.
    Essentially I have 16bit images that are loaded into my
    shockwave application at run-time. These images are user defined
    which means that I will not know their size ahead of time. Once the
    images are loaded I then create textures and apply them to various
    shaders. Ok, all of this works just fine. What I need to do though
    is create an alpha transparent border around the images, so when I
    apply them to their surfaces I only see the image and nothing
    around it. I am doing this because these images will only appear at
    specific parts on a surface, textureRepeat will be false, and many
    models will be stacked in the same exact location using the same
    model resource. I have everything working, but I cannot figure out
    the alpha part for the life of me. Also, when I test the alpha
    based image by itself it works just fine. It is not until I try and
    combine the 16bit (converted to 32bit at run-time) image that I run
    into problems.
    I have tried:
    - Creating a 32bit alpha image in Fireworks with a
    transparent border and a black rect for the inside. I then copy the
    dynamic image over the alpha image (only after going from 16bit to
    32bit in imaging Lingo) and leave a little room at the edges for
    the transparency. Well, I get a crazy amount of streaks here even
    when I try to up the trans border by around 24 pixels on each side.
    - Using another similiar alpha based image as a mask with
    copyPixels and extractAlpha/setAlpha like this... (code is a little
    rough here)
    newImage = new(#bitmap)
    newImage.name = "place_Test"
    newImage.image = member("place").image
    newAlpha = new(#bitmap)
    newAlpha.name = "AHH"
    newAlpha.image = image(newImage.image.width + 24,
    newImage.image.height + 24, 32)
    newAlpha.image.useAlpha = true
    newAlpha.image.copyPixels(member("vase").image,
    newAlpha.image.rect, member("vase").image.rect)
    newAlphaInfo = newAlpha.image.extractAlpha()
    newAlpha.image.useAlpha = false
    --reverse dark to light
    iAlphaReverse = image(newAlpha.image.width,
    newAlpha.image.height, 8, #grayscale)
    iAlphaReverse.fill(iAlphaReverse.rect, rgb(0,0,0))
    iAlphaReverse.copyPixels(newAlphaInfo, iAlphaReverse.rect,
    newAlphaInfo.rect, [#ink : #reverse])
    --newAlphaInfo.copyPixels(iAlphaReverse, newAlphaInfo.rect,
    iAlphaReverse.rect, [#ink:#subtractpin])
    newAlphaMask = iAlphaReverse.createMask()
    rescaleAbs(newImage, newImage.image.width,
    newImage.image.height, "place_Test", 32)
    destImage = member("place_Test").image.duplicate()
    destImage.fill(destImage.rect, rgb(0,0,0))
    newAlpha.image.useAlpha = false
    destImage.copyPixels(newImage.image, newImage.image.rect,
    newImage.image.rect, [#maskImage:newAlphaMask, #ink:#add])
    destImage.setAlpha(iAlphaReverse)
    destImage.useAlpha = true
    member("place_Test").image = destImage
    I apologize for the messy code. I have cut and pasted from
    all over the place and am getting confused. In any case, I think I
    am making this harder then it needs to be and hope someone can
    help.
    Thank you in advance,
    Dave

    Hi, you can try using other texture layer as mask on the same
    shader. As usually you create the texture from a dynamic loaded
    image, then apply this texture to the shader on the texture list
    index 1 (textureList[1]). Next part does the job, create other
    texture from a 32 bits image with the alpha information and fill
    all pixels with white color, this is very important because the
    second texture layer will be multiply with the first texture layer.
    This texture set its render format to rgba8888. Apply the mask
    texture to the same shader at texture list index 2, verify that the
    blendFunctionList index 2 is #multiply.
    I include the code of a project that use this masking
    approach:
    property pMember
    property pEarthSphere
    property pNightSphere
    property pLastTransform
    on beginSprite me
    pMember = sprite(me.spriteNum).member
    me.setupWorld()
    end
    on setupWorld(me)
    pMember.resetWorld()
    repeat with i = pMember.light.count down to 1
    pMember.deletelight(i)
    end repeat
    vEarthModelResource = pMember.newModelResource("EARTH MODEL
    RESOURCE", #sphere)
    vEarthModelResource.radius = 50.000
    vEarthModelResource.resolution = 20
    vEarthTexture = pMember.newTexture("EARTH TEXTURE",
    #fromCastMember, member(3,1))
    vEarthShader = pMember.newShader("EARTH SHADER", #standard)
    vEarthShader.emissive = color(255,255,255)
    vEarthShader.flat = TRUE
    vEarthShader.transparent = FALSE
    vEarthShader.textureList[1] = vEarthTexture
    pEarthSphere = pMember.newModel("EARTH MODEL",
    vEarthModelResource)
    pEarthSphere.shaderList = vEarthShader
    vNightModelResource = pMember.newModelResource("NIGHT MODEL
    RESOURCE", #sphere)
    vNightModelResource.radius = 50.2000
    vNightModelResource.resolution = 20
    vNightTexture = pMember.newTexture("NIGHT TEXTURE",
    #fromCastMember, member(4,1))
    vNightTexture.quality = #lowFiltered
    vNightTexture.nearFiltering = FALSE
    vNightTexture.renderFormat = #rgba8880
    vNightShader = pMember.newShader("NIGHT SHADER", #standard)
    vNightShader.emissive = color(255,255,255)
    vNightShader.flat = TRUE
    vNightShader.transparent = TRUE
    vNightShader.textureList[1] = vNightTexture
    vMaskNightTexture = pMember.newTexture("MASK NIGHT TEXTURE",
    #fromCastMember, member(6,1))
    vMaskNightTexture.renderFormat = #rgba8888
    vNightShader.textureList[2] = vMaskNightTexture
    vNightShader.textureModeList[2] = #wrapPlanar
    pNightSphere = pMember.newModel("NIGHT MODEL",
    vNightModelResource)
    pNightSphere.shaderList[1] = vNightShader
    pNightSphere.parent = pEarthSphere
    end
    on exitFrame(me)
    pEarthSphere.rotate(0.0,0.1,0.0)
    me.moveMaskNightTexture()
    end
    on moveMaskNightTexture(me)
    vRotationVector = - pEarthSphere.transform.rotation
    pNightSphere.shaderList[1].wrapTransformList[2].rotation =
    vRotationVector
    end

  • How do you size a picture in Photoshop Element 11

    How do you size picture's to be sent in a email? On the old version I could figure it out be now on this version I can find where to do this. Also how do you make a collogues in Photoshop Elements 11
    Thank you for your help, Jack Frowein

    if you are saving your image as jpeg and really dont care much about the pixel dimension and just worry about the file size, I think using lower jpeg compression ratio is a better option.  For example: if i want my image to have really small file size, I would simply use a lower jpeg quality(probably Medium or low) while saving the file.
    Another easy solution would be to use Save for web, which shows you enough save options to precisely control your file size and dimension

  • How to display  servlet dynamically generated image ?

    Hi,
    How to display servlet dynamically generated image ?
    I have a servlet generating a buffered image in the doGet. I want to display the image in a jsp page with other information. I'm not able to get it properly displayed.
    **Try n# 1 **************************************************************
    This displays my image but nothing elle :
    ServletOutputStream sos = pResponse.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sos);
    encoder.encode(img);
    **Try n# 2 ****************************************************************
    I tried also :
    In the servlet :
         request.setAttribute("renderedImage", img);
    and in the jsp page :
         BufferedImage image = (BufferedImage) request.getAttribute("renderedImage");
         <img src="<%=ImageIO.write(image,"jpeg",response.getOutputStream())%>" width="300" height="280"/>
    This last try draws big crap in the jsp page, thank you in advance.
    Nelson

    Call another servlet from the IMG tag. Have the servlet stream out the image using ImageIO (instead of writing HTML).

  • Dynamically loading images: UI Loader issue

    I posted this last week, but did not show good examples to get help. Admittedly, I am new to flash, so this may be a bit elementary, so my apologies in advance. I am trying to dynamically load images through the UI Loader component. Attached are the errors I get, and although I think that the coding is close to correct, when I publish, it just flashes up then restarts the movie... any ideas? Thanks in advance.

    there's a problem attaching things to this forum.  so, nothing is attached.
    can you copy and paste your error messages to this forum?

  • Dynamically loaded images cached?

    We have an xml feed that is refreshed every hour. According
    to the xml file, we dynamically load an image into an html text
    field each time someone hits our page. All of the images have been
    recently updated, but the old ones are still appearing? We use the
    swf?nocache=randomnumber convention to make sure the swf file
    itself isn't cached, but is there anything we can do to clear out
    the cache of dynamically loaded images? If there isn't anything we
    can do, will these all eventually refresh themselves? This is how
    the html is generated where "twcImage[0]" is the image in question.
    Thanks!

    Do the same random number for the images.
    twcImage[0] + randomnumber
    Dan Smith > adobe community expert
    Flash Helps >
    http://www.smithmediafusion.com/blog/?cat=11
    http://www.dsmith.tv
    "Wolli World" <[email protected]> wrote in
    message
    news:fvvcrc$k9o$[email protected]..
    > We have an xml feed that is refreshed every hour.
    According to the xml
    > file,
    > we dynamically load an image into an html text field
    each time someone
    > hits our
    > page. All of the images have been recently updated, but
    the old ones are
    > still
    > appearing? We use the swf?nocache=randomnumber
    convention to make sure
    > the swf
    > file itself isn't cached, but is there anything we can
    do to clear out the
    > cache of dynamically loaded images? If there isn't
    anything we can do,
    > will
    > these all eventually refresh themselves? This is how the
    html is
    > generated
    > where "twcImage[0]" is the image in question. Thanks!
    >
    > twcTarget.text = "<img align='left' hspace='5'
    vspace='0' src='
    http://" +
    > _root.server + "/rss/weather/images/" +
    > twcImage[0] + "'>" + "<condition>" + ... and so
    on
    >

  • How to replace wecenter default loading image(ss.gif).

    Hi All ,
    I am working on webcenter customization .
    Can anyone provide me how to replace webcenter default loading image which appears before webcenter content gets loaded .
    Appreciate any prompt response .
    Thanks ,
    Arun.

    If it's the splash screen you speak of, a custom skin defining these selectors may work - af|document::splash-screen, af|document::splash-screen-content, af|document::splash-screen-message and af|document::splash-screen-icon.
    Please note that I have not tried these myself.

  • How do you save a transformed image?

    Windows Store App 8.1.
    I have an image that the user has rotated, scaled and clipped etc.  How do you save the transformed image?
    There are solutions of the forums but these use the System.Media.Imaging library that isn't available, classes like the TransformedBitmap etc. are not available. 
    I'm playing around with this approach but the decoder throws a "The image format is unknown"; 
    imageManipulation is UIElement.Image.
    Any ideas on how to achieve the saving of a Transformed image in a 4.5.1 8.1 store app?
    RenderTargetBitmap rtb = new RenderTargetBitmap();
    await rtb.RenderAsync(imageManipulation, (int)imageManipulation.ActualWidth, (int)imageManipulation.ActualHeight);
    IBuffer buffer = await rtb.GetPixelsAsync();
    using (InMemoryRandomAccessStream ras = new InMemoryRandomAccessStream())
    await ras.WriteAsync(buffer);
    await ras.FlushAsync();
    BitmapDecoder dec = await BitmapDecoder.CreateAsync(BitmapDecoder.BmpDecoderId, ras);
    Rob

    Hi,
    You can use BitmapEncoder to apply transforms such as scaling and cropping, set metadata and properties, and edit pixels while preserving any unedited
    data. After transform the data, you can copy the contents from the in-memory stream to the original file’s stream and close all of the streams. That make you can save the encoded image to the file:
    memStream.Seek(0);
    fileStream.Seek(0);
    fileStream.Size = 0;
    await RandomAccessStream.CopyAsync(memStream, fileStream);
    fileStream.Dispose();
    memStream.Dispose();
    You can see the link to get more information:
    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj709937.aspx
    Best Wishes!
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • How can you get a mirror image of a photo on iPhoto?

    How can you get a mirror image of a photo on iPhoto?

    By using an external editor. Preview is already on your Mac. It's called 'Flip Horizontal'
    In order of price here are some other suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate or the App Store.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How do you display a new image in  webdynpro view?

    How do you display a new image in  webdynpro view?
    Where is the image stored and how do we specify the image path?

    hi ,
    The UI element Image enables you to integrate graphics into the Web application in a format that is processed by the Web Server u2013 for example, GIF, JPG, and PNG format. Height and width of the graphic can be specified using the properties height and width. The graphic is displayed without borders.
    saveur image   as mime
    with Mime Objects u cn upload doc , jpeg, or giff files from our local system into the webdypnpro system .
    Right click on ur component->mime object->import
    In the transaction sicf/bc/webdynpro , u cn check your component name there you can view the mime objects created by you .
    also refer the SAP online help :
    http://help.sap.com/saphelp_crm50/helpdata/en/46/bb182fab4811d4968100a0c94260a5/content.htm
    to knw more abt mime repositories.
    http://help.sap.com/saphelp_nw04/helpdata/en/f3/1a61a9dc7f2e4199458e964e76b4ba/content.htm
    regards,
    amit

  • How do you weed through duplicate images?

    I love that Aperture allows tasks to be done many different ways. I'd like to hear some ideas on how to do this -
    I am going through and finally getting my old photos from 2002 to current managed in Aperture. Many of the images are a mess on CD backup and more recent images are from the pc (I could get these from an EHD or in iPhoto). Long story short, I have LOTS of duplicate images from one disk to another. I mean the same photo two or three times.
    My library has a top blue folder for the year. The projects within there are almost all by month year (i.e. Apr 2003). As far as I can tell, all of these images are the same - but one project might have an image that another one doesn't have. Should I worry about this or not? I am very detail oriented and anal about it - so set me straight if I need a slap into reality
    Should I just go through my library and view by date and delete the duplicates without regard to which CD they came from? What would you do? How do you weed through duplicate images in this regard?
    I'd love to hear your thoughts!

    I almost thought you hit a winner there... even for general use. I started to read it and realized the import window cannot be resized. Why did I think that? Well, in general, have you ever imported from your camera and then took more pictures? Do you always remember what the last downloaded image was? Wouldn't it be great to resize that import window and see the actual library underneath to check??!
    Anyway, my imports are done so .... last night I did a few months worth and I was in date view within 2003 (not the smart folder at the top under Library) and went through using the 9 key to reject the images that were duplicate. Some of them I could go to the project and reject in larger groups, but mostly it was one by one. It is a painstaking process, but ensures I have every image. Once I know I have it all, I will delete the rejects.
    Keep in mind - my duplicates are not in the same project - they exist in multiple projects, sometimes two or three.
    No other tips out there? I was sure there were enough power users that would have some secret tip to make life easier with Aperture.

  • When making a photo book in Aperture. How do you eliminate having the image numbers under the pictures?

    When making a photo book in Aperture. How do you eliminate having the image numbers under the pictures?

    Click the "Book Actions" cogwheel and select "Page Numbers " -> "Off"
    Regards
    Léonie

  • How do you print multiple different images on a single page in preview

    How do you print multiple different images on a single page in preview?

    Chances are no one who saw your question knew the answer.
    Unless you're willing to share the answer you found here, then anyone else like you searching for the problem who comes across this thread will also be unable to thank you for providing the answer too.  

Maybe you are looking for

  • Need To Create Box That Shows Previous Month Label And Amount Of Sales

    I am using CR2008 I am creating a report for our salesmen and one of the fields in the report will be a text box that shows what the last month was. For instance, if the report is run this month, the report will plug July 2011 into the box because th

  • The home button on my ipod 5th gen has stopped working comletely.

    I have had my 5th gen ipod touch for almost a year now. I never drop it. i take good care for it. its a 64 GB one so it was heaps of money. LIke 90% of my life is on that thing. Should i ask for a replacemeant or is it possible for it to be fixed? I

  • Problems with storage after failure of restore from TM back up.

    Okay, so I've become so frustrated over this that I've decided to see what is the issue. After a horrible incident where I inadvertedly removed the OS start up disk (I unsuccessfully installed Windows 8 without the proper drivers...long story really)

  • No auth error while executing BI integrated planning Query

    Hi to all, I have created integrated planning Query in Bex Query designer. But while executing BI integrated planning query in portal, its giving errror. 1.     No authorization for query "IP" 2.     You are not authorized to edit this aggregation le

  • Strange iChat problem, need assistance.

    Since My girlfriend had a system and a quicktime update somewhere last 2 weeks, we have a problem with the videochat. Her system is Leopard version: 10.5.6 and quicktime version 7.5.7 My system is Tiger version: 10.4.11 and quicktimepro version 7.5.5