I have two images of different sizes. If I want to overlay the smaller one on the bigger one with the given position, how should I use the CompositeCmd to do this?
thanks
hammer
Related
I have a very simple requirement here but I'm looking for a solution for a while. I want to take a profile picture form the camera roll or camera and display it in two different image views (different sizes). I don't want any of these images stretched or miss any part of the image. If I use aspect to fit, top side of image is cut from smaller image view and some parts missing on the bigger image view. If I set it as scale to fit, it will get stretched!
I'm not sure how some mobile apps work. Do they save different image sizes in their server or they change the size of the image. I saw many posts how to change image size without changing aspect ratio. But I don't think it is possible to avoid stretched effects. I used some of those code to change size of image, it gets stretched all the time.
Is there any way to save the image from camera roll one time with size of 140*200 and one time 160*200? So I can use 140*200 for image views that size. But what if I have different devices and different sizes.
I have two images, one larger than the other. My need is to be able to drag and place the smaller image anywhere above the larger one. The problem is that, I don't want the portion of the smaller image outside the larger image's boundary to be seen. Once the smaller image's non-transparent portion stops overlapping the larger image non-transparent portion, the non-overlapping smaller image portion should be hidden.However, when the smaller image is completely inside the larger image's non-transparent portion, it should be visible.!
[For eg., the image shown consists of a larger image that is a T-shirt and a smaller image that is of a lady.I want to add the image of the lady over the T-shirt. It should be possible to move the image of the lady anywhere inside the T-shirt.And once the image of the lady moves out of the T-shirt's outer black boundary the non-overlapping portion of the image of the lady should become transparent. Here, the portion of the T-shirt image outside the black boundary is transparent. Can someone help me with the code?
Your requirement is a pretty complex one. If the "T-Shirt" part is static than again it is easy for you to mark boundaries for that image. But if there is different background than you need to do more stuff.
Here you have to take a help of Core image. You need to process that image and get the core details of that image. Also "Morphological Operations" will help you to detect object from image. Take a look on links:
Core image processing
Morphological Operations
Also about the drag and drop follow this one.
OBDragDrop
I have 2 relatively small pngs that will be images inside UIButtons.
Once our app is finished, we might want to resize the buttons and make them smaller.
Now, we can easily do this by resizing the button frame; the system automatically re-sizes the images smaller.
Would the system's autoresize cause the image to look ugly after shrinking the image? (i.e., would it clip pixels and make it look less smooth than if I were to shrink it in a photo editor myself?)
Or would it better to make the image the sizes they are intended to be?
It is always best to make the images of correct size from the beginning. All resize-functions will have negative impact on the end result. If you scale it up to a larger image it will be a big different, but even if you scale it down to a smaller it is usually creating visible noise in the image. Let's say that you have a line of one pixel in your image. scale it down to 90% of the original size, this line will just use 90% of a pixel wide and other parts of the images will influence the colors of the same pixels.
Is there a standard methodolgy for scaling image buttons using one image size across multiple blackberry phone model screen resolutions ?
I'm resizing encoded iamges based on display width.
So to resize an image to a quarter length of the screen I do -
imageLength = Dislay.getWidth / 4;
Is there something better ?
Thanks
I'm not sure I understand what you need.
Do you want to scale an image? If so, take a look at scaleImage32(int, int) method. Also, you should use methods from the Fixed32 class to calculate image sizes.
If you only want to scale a button, maybe this answer will help you.
I have a bunch of images that have a single color overlay with some text on it positioned at the bottom. Not all images have the overlay and the overlay is not of the same height on every picture.
I am looking for a way to detect the overlay rectangle, and crop only the part of the image without it.
Trim seems the logical way to go, but the text on the overlay makes trim remove only the part below the text.
Any ideas would be welcome.
Thanks!
Make a copy of the image and crop it to just the left-most 5 pixels (assuming that there's some left margin to the text), trim and find out the new height. Then use the height of that trim to crop the original.