I need to load images within my Flash project
I don't want to use the Loader class cause the images are from a different domain.
I load images with a TextField
Here is my code:
var ti:TextField = new TextField();
ti.border=1
ti.htmlText += " <img id='movieInTxt' align='center' src='"+pic+"' />";
allMC[counter].img.addChild(ti);
I am loading the images to movieClip in a shape of a box.
I want to position the image in the center.
How can I make it ?
I tried ti.autoSize = TextFieldAutoSize.CENTER but it doesn't work...
Any suggestions how to load an image and position it in the center ?
You can use <p align='center'><img /></p> I guess.
You can totally use a Loader on domain you don't own since you don't access any advanced properties on the image (like pixel-level manipulations). You can then access the size of the image, and center it in your container.
AS3 doc says :
You can load content from any accessible source.
If the loaded content is an image, its data cannot be accessed by a SWF file outside of the security sandbox, unless the domain of that SWF file was included in a cross-domain policy file at the origin domain of the image.
You can force flashplayer to not check crossdomain.xml file by passing false in the LoaderContext constructor :
myLoader.load(urlReq, new LoaderContext(false));
Related
I am using the Carousel View to display a frame that includes both images and text. I am retrieving the data from an API, the text binds properly to the labels, but the byte array does not properly bind as the image source. I have tried setting the source of an image external to the carousel view called "bell_img" and it shows the image from the byte array properly. I have also tried binding the image source inside the carousel view to an image that I have stored as a resource in my application, this image is showed properly inside the carousel view. Its very strange that the byte array image does not work only inside the carousel view, because both the things I have tried show that
ImageSource imageSource = ImageSource.FromStream(() => new MemoryStream(event_list[i].image)); (works correctly)
And that the binding is also correct because it works with images in my resource folder.
CODE
When setting ImageSource2 as the binding, instead o ImageSource, the image shows correctly.
I'm sharing a bunch of images between a React layer and an AFRAME VR layer.
I've preloaded the images into in an assets entity (not using the aframe asset manager as these assets are loaded dynamically at run time)
i.e.
const asset = getAsset(state, assetId, thumbnail)
const image = new Image()
image.id = assetId
image.src= asset.url
document.getElementById('assets').appendChild(image)
When switching too VR, I'm trying to use the same assets to load the thumbnails
i.e.
const thumb = document.getElementById(assetId)
this.el.setAttribute('src', thumb.src)
However the browser is reloading the assets.
In this comment https://stackoverflow.com/a/44868733/2884250
Loading images as img in AFrame doesn't store them in THREE.Cache
therefore the image was loaded twice. But if you load the image as
a-asset-item it does.
So I've attempted to add the files to the THREE.Cache (I'm assuming as a src)
window.THREE.Cache.add(assetId, asset.url)
How then in AFRAME do I get this image into the AFRAME A-IMAGE Entity as a src?
Figured it out..
Add the image to the cache with the ID
image.onload = () => window.THREE.Cache.add(assetId, image)
And use the ID as the SRC
this.el.setAttribute('src', '#'+assetId)
I'm trying to clip an image overlay in Google Maps API, however without success. I can clip a HTML image successfully and overlay it on a Google MAP by using the CSS clip property and z-index property, however that's no use, as the image does not adjust to the Google map zoom and movements. i.e. the image is not bound to the Google MAP object in any way, doesn't respond to map changes.
If I assign the Google Map overlay to the cropped image source, it simply uses the original un-cropped source and not the cropped page image element. That's just how the image.src property works.
I successfully added an image overlay for Google MAPS, but there does not seem to be any clipping or cropping function for them. There is text on the image that I don't want to display for this application, but I don't want to crop the original source file image, as it's used for multiple display purposes.
historicalOverlay = new google.maps.GroundOverlay(imageurl,imageBounds);
historicalOverlay.setMap(map);
I need imageurl to point to a clipped version in memory or something like that or the clipped form image element, but not its un-clipped source image. Any ideas ?
The GroundOverlay class in Google Maps javascript API V3 does not provide any support for in-browser clipping/cropping of the image before display.
Because we needed that capability, plus some others like image rotation and non-rectangular images, we wrote a GroundOverlayEX javascript class that supports everything that the Google Earth version of GroundOverlay supports, including browser-side clipping/cropping of the image to-be-displayed.
The javascript class is open-source on Github at: https://github.com/azmikemm/GroundOverlayEX. There is API documentation as well (documentation.txt). All images shown by the GroundOverlayEX class are integral to the map, and will drag with the map, and zoom with the map.
A working functional example of the class in-action (with some clipped/ cropped images) is at: https://sites.google.com/site/issearthatnight/
If you turn off the VIIRS checkbox, and set the transparency down to midway, you'll see the images pretty plainly, and see that some are cropped (all are stored in NASA's servers as rectangles, so images that are square-ish or look like slices have been cropped by the GroundOverlayEX class).
I want to resize product images before upload them by using values through text boxes.
eg:
user browse image and then give width(px) in one text and height(px) in another textbox click on apply and now this size is apply on image.
then user upload image.
can any one tell me or guide me to resource so i can get this functionality.
i already added both text box with button on product image upload grid.
What is the point? Magento spares you from any of that fooling around with images. You upload them in whatever size you want hen it creates and caches the sizes it needs on the fly. What your trying to achieve is a leap backwards.
Please use this code to resize your image
$imageUrl = "http://localhost/";
$imageResized = Mage::getBaseDir('media').DS."catalog/category/resized";
$imageObj = new Varien_Image($imageUrl);
$imageObj->constrainOnly(TRUE);
$imageObj->keepAspectRatio(TRUE);
$imageObj->keepFrame(false);
$imageObj->keepTransparency(True);
$imageObj->setImageBackgroundColor(false);
$imageObj->backgroundColor(false);
$imageObj->quality(100);
$imageObj->setWatermarkImageOpacity(0);
$imageObj->resize(120, 120);
$imageObj->save($imageResized);
I think you have to look at this controller.
Mage_Adminhtml_Catalog_Product_GalleryController
You will need to rewrite this controller. Some how make the width and height values arrive to the action. And than apply re-sizing to the image.
HTH
I know that in Mango, we can update the Tile's background locally.
But "StandardTileData.BackgroundImage" is of the type Uri, does this mean I have to use an Image that was added to the project's resource?
Or can I render a bitmap on-the-fly and use it as the Tile background?
Thanks
I haven't checked but I would assume that you can create an image in "on-the-fly", save it to Isolated Storage and then set the source of the tile image to be a relative URI which points into IsolatedStorage.