Scaling images down looks awful - image

I have an image for a mobile game and im scaling it down depending on the screen but the image looks awful, for example some lines dissapear, its like the image squeezes and the lines are so thin they simply dissapear. How can i solve this problem?

In As3 Bitmaps have property smoothing, and by default It's false.
Set it to true, and you will have better results.

Related

SpriteRenderer Image getting stretched down

I had a spriterenderer for a square but I want to change it from looking like a basic rectangle to having an image instead. So I tried changing the sprite renderer "Sprite" to the image I wanted but whenever I do so the image is looking pixelated, ugly and stretched and I can't rescale it properly.
Before:
After:
The image may look ugly because it is stretched. In your hierarchy, select the GameObject with the SpriteRenderer. Then set the x,y,z scales back to 1.
If it still looks weird, select the image in your assets folder, and play around with the quality & filter settings (Don't forget to click apply). Hopefully this helps with making the image look nicer.
If not, ensure that your image asset is not a low resolution either.
I'm not really sure what you mean about it not rescaling properly. If you could please elaborate then hopefully we can fix it :)

How to make CGWindowListCreateImage render correct background color?

Capturing an image of an off-screen window with CGWindowListCreateImage is a common way to create QuickLook style zoom-in animations, but this seems create an image with the wrong background colour, slightly lighter than the real window.
This causes a flash at the end of the animation which kind of ruins the effect.
Does anyone have any idea why this happens and what can be done about it?
EDIT: I created a demonstration app for this problem. It is a bit large and complex for a Stack Overflow question, but the relevant code is probably in the ZoomingWindow.m methods takeSnapshot and makeAndPrepareSnapshotWindow.
Setting the window appearance to textured in Interface Builder fixed this. Of course that also changes the color of the window, but that is acceptable in this particular case.

Codename One: How can I scale an image to fit width of screen?

Good evening,
I'm using Eclipse with the UI-Framework Codename One.
I would like to know how it would be possible to scale an image to fit the width of the screen?
I would like to create a list with one image( or even an imageslider if this is possible), which has the full width of the phone, and under that some text.
Another question is, how can I set an Image via Hastable and Vector from code ? I tried everything but I can't find a solution.
Thank you a lot,
Greetings Patric
It depends on what you are trying to do.
Normally you would just set the image as the background image of the component and select the background behavior as SCALE_TO_FIT which can be done both via the theme designer and via the Style object of the component.
You can also use the ImageViewer class if you want to have a viewable/zoomable image.
You can also just scale the image to the size you want using either the scaled() method or ImageIO.

images looks upside down in browser while in image editor looks perfect

i am having strange issue.
check this images.
http://project.demotestserver.com/card/spider-web-in-vines.jpg
http://project.demotestserver.com/card/thomas.jpg
http://project.demotestserver.com/card/Storm-cloud.jpg
just save these images and open it in image editor it looks perfect perfect .
in browser these images looks rotated while for the image editor it looks perfect.
due to these issue images looks rotated on my site. how to fix this thing?
if i will rotate images it will look perfect in browser while rotated in editor and desktops. for mobile it looks rotated as actual.
what is the solution of it.?
They don't look rotated to me on my system. Perhaps you need to strip out EXIF data that contains orientation information?
Information on the problems caused by EXIF orientation tags: http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/

Why is local image turned 90 degrees on UIWebView

I have an application that is set in landscape mode because of the content it contains. One of the things I want to do is take a picture of a piece of paper. I present the UIImagePickerController locked in portrait mode because it fits the paper size. After the user takes the picture I load that image as a background on a UIWebView. The reason I use a webview is because sometimes I need to load a .pdf there as well. Anyway, I'm setting the background using CSS. Here is the code...
//img is the path to an image.
myHtml = [NSString stringWithFormat:
#"<html><head>"
"</head>"
"<body><img src='%#'></body></html>", img];
[resume loadHTMLString:myHtml baseURL:baseURL];
The problem is, the image is displayed in landscape when the app returns to the UIWebView. Everything else is normal as far as text etc. Is there some reason that images are rotated 90 degrees to fit properly or something? I have tried pretty much everything with no luck.
The other thing is that we I retake a picture and reload the webView the old image remains.
You need to change the orientation of the image from its exif header if there is orientation info available in it. Identifying the picture orientation is the hard part, rotation of imgs can be done easily using css -webkit-transform: rotate(-90deg);
It does have to do with the exif data. While using a webkit transform may be ok for use in just the web view once, if you want to use the image later and have it always be the right orientation I'd use the categories given here:
http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
The article does a great job explaining exactly why the rotation occurs and the code does a nice job of 'fixing' the 'problem' so that you can then make use of the image without having to do extra things or worry about whether it'll be displayed correctly (even though the UIImageView takes the orientation into account).
You can resize with this to the same size it originally was, and it should fix the orientation issue.

Resources