nine-patch Image vs regular Bitmap Image - image

Different between nine-patch Image vs regular Bitmap Image in Android. and where we use nine-patch Image and where we use regular Bitmap Image.

9 patch images allow you to choose the area of the image that can be scaled and the area that should keep unscaled, unlike the regular images that are scaled along height and width in the same way.
For example this image, where the corners will not be scaled
It is useful for layouts that can vary greatly in size.
To control scaling in regular images you can use ScaleType property of ImageView

These description from Google search:
What Are 9 Patch Images
https://github.com/chrislondon/9-Patch-Image-for-Websites/wiki/What-Are-9-Patch-Images
Google Slideshow: https://docs.google.com/present/view?id=dc7ghz8w_34f8338rcg
very very helpful tool to understand 9 patch image:
https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#source.type=image&sourceDensity=320&name=logo_cbfea26

Related

Xlsxwriter rotate image

I am downloading a number of images to my local drive then adding them to a spreadsheet using insert_image(). The images are correctly oriented in Windows Explorer and other image viewing apps. However when I add an image (portrait) to the spreadsheet it becomes rotated to landscape. Landscape images do not appear to be rotated.
I also have a URL link for each image. When I click the image it opens up in a viewer in the correct orientation. It appears as if the insert_image is not respecting the image orientation. The EXIF information does not contain orientation.
Is there a way to specify image orientation, or rotate the image before inserting?
Thanks in advance,
Ian
Thanks for your help. That does seem to be the behaviour. xlsxwriter insert images in the ‘raw’ orientation of the image.
I was trying to insert images which have exif information, where all image are captured in the same orientation - in supported viewers exif flag is used in to rotate the image to the way the camera was oriented when taking the photo. I have solved the problem by applying the rotation to the image before inserting it into excel using xlsxwriter.

How to extract on-screen area on XD of an image

I just received the XD file from the designer, now am trying to extract the nav area image from the canvas but image is too spread out from the canvas how it can be cropped to the area of the nav.
Use Adobe Photoshop To Resize them to Fit Original image
or
if you want part of image you can use one of image magnify plugins first
they will fit image to canvas
then use export
Also you can use Web Export Plugins

nothing happens when I attempt to textout to a transparent image

I am using Lazarus.
I have put 2 images on a form and synchronized their positions and sizes.
I can textout to both images, and after I made the ontop image transparent I can see the combined content of both images.
I can add further text to the bottom image and see it, but I can't see text I try to add to the transparent image.
I used the following code to make the top image transparent
image2.picture.Bitmap.TransparentColor:=clWhite;
image2.transparent:=true;
I guess I need to play with the image bitmap, but I can't find a solution that is not using other software.
Can someone help me with this please?

Images & Icons are getting pixelated when gallery loads

I have a Content Slider (All-in-one-banner sort of) on the home page of my website.
Every time this banner slides onto the next image in the queue, the other images (png format) on my page are getting pixelated. Especially it happens in Chrome.
Images and Icons such as the logos, icons used for navigation, etc... - they get pixelated when a new slide changes on the banner.
Please help me.
Demo link (Open in chrome):
When the slides in the banner change, Look at the logo on the top and the logos to the right, and also the profile pics below,: indiaemerge.com/ieys2013
The solution I could figure out is that one should NOT use an image with large dimensions.
For example: I was trying to use an image of size 800px X 400px to fit it into a division of 200px X 50px. Because of this the image was getting distorted when slides would change.
I reduced the dimensions and resolution of the image to match the target division's dimensions and it worked.
Another way to fix this is to use an svg image file.
So the lesson to be learnt here is that always try to use an image (in case it is png or jpg) whose size meets your requirement as precisely as possible. If it is an svg image file then there won't be any problem.

How to Crop image to the maximum image rect?

In Mac OSX,
I have an image with black pixel in all 4 directions.
I want to programmatically crop the image to the maximum image rect.
Should i check for the black pixel and then create the crop rect or is there any supported API is there?
Create an NSImage of the desired size, lock focus on it, draw the desired crop rectangle of the source image into the whole bounds of the destination image, and unlock focus. The image you created now contains the crop from the source image.
Note that this will lose information like resolution (DPI), color profile, and EXIF tags. If you want to preserve those things (probably a good idea), use CGImage:
Use CGImageSource to load the image. Be sure to recover the properties of each image from the file, as well as the images themselves. And note that I used the plural: TIFF files can contain multiple images.
Use the CGImageCreateWithImageInRect function to crop out the desired section of each image. Don't forget to release each original image as appropriate.
If you want to write the cropped-out images to a file, do so using CGImageDestination. Pass both the images and the attributes dictionaries you obtained in step 1.

Resources