How to use vector images in Xcode 6.4 - xcode

I've drawn up an image in Adobe Illustrator CS6. I export/save the image as a PDF. In Xcode, I create an image set and set the scale factor to Single Vector.
Yet when I use the image in my app, it still appears pixilated.
I've used vector images in older versions of Xcode (6.1 & 6.2) and it worked fine. Why is it not working in 6.4?

Try this article. It describes how to save vector image correctly and how to use it in Xcode.
IMPORTANT TO KNOW: Xcode slices your vector image to needed dimension. E.g. if you'll put 50x50 vector image it will create 50x50(x1), 100x100(x2), 150x150(x3) images. So you should to save original vector image for x1 dimension.

If you are testing on the simulator, try testing on an actual device. If you look at the images on all the other apps that are in the simulator, you will notice that they are all pixilated also.

Related

Xcode custom symbol image set asset

From Apples documentation I read:
An alternative to creating bitmap images is to use template images or symbol images instead. Template images specify the shape you want to draw, but not the associated color information. Symbol images are similar to template images but are vector based, so they scale to different sizes. Both types of images simplify the process for supporting Dark Mode. They also reduce the number of image assets you must ship with your app.
Do I understand this correct that I can not use a vector based symbol image set as a replacement for bitmap but scalable?
Update
My situation:
I've an Image Set in my iOS project. There I can add three bitmaps for the three scaling options iOS devices support. Those images must be of type *.png
Now I would like to replace those three bitmaps with a single vector graphic file *.svg. This seems not possible. If I want to use vector graphic images I've to add another asset type called "symbol image set" (Xcode -> Editor -> Add Assets -> New Symbol Image Set).
So far so good but now my question. Those "symbol image set" assets only the the shape but not the color information into account. That's why I would like the "old" way where the color information is taken into account but the file being a vector graphics file (*.svg).
You don't actually need a Symbol Set for what you are trying to achieve.
All you need is a vector image in pdf format, marking it as Single Scale
Then, you can mark the asset as template (meaning you can tint it with any color) or original if you want to retain its original colors.
Finally, note that although you supply vector images, Xcode by default will produce png versions for all scales behind the scenes. If you need to preserve the vector data (which can help in some cases where you need to upscale) you can enable Preserve Vector Data as well.

Swift 4 How to force Xcode to render vector images?

I am writing the app using latest Swift 4.1.2 and Xcode 9.4.1 for iOS 11.4. So I want to use vector images in my app in PDF format. I made the simple app which showing the problem, please, look:
This app only show only one image, but if you rotate the screen, rendering happens and picture becomes beautiful.
So the question is: how to force Xcode render vector images in Main.storyboard without touching the code? So app upload already rendered images?
Go to -> Images.xcassets and select the image. From the attributes inspector, make sure that preserve vector data is checked as following:
I hope it solves your problem.
Xcode 9 changes situation for vector data by allowing you to choose to treat the image as a vector at runtime. This means the image can smoothly scale to arbitrary sizes. The only change you need to make is to tick Preserve Vector Data for the PDF image in the asset catalog.

What does Auto Scaling do in Xcode 10 xcasset image properties

Found new option on xcasset catalogue image property in Xcode 10 called "Auto Scaling".
What does this property do?
Is it in any way related to Resizing: "Preserve Vector Data" when using PDF vector assets?
It looks like this may only be used by WatchOS.
From https://developer.apple.com/documentation/watchkit/supporting_multiple_screen_sizes?language=objc
Alternatively, in watchOS 5 and later, you can provide scalable PDF assets. Add a PDF as a 2x image asset, then set its Auto Scaling attribute to Automatic. When you load the PDF, the system scales the image based on the current device’s screen size as listed in the table. This allows you to provide a single asset for all four screen sizes.
I'm not sure if this works on iOS as well. I was unable to find any mention of auto scaling outside of this WatchKit documentation.

WP7 - Splash Screen doesn't display correctly on launch

What I'm trying to do:
I've added a splash screen to an application I'm creating for Windows Phone 7. I did this simply by replacing the pre-existing splash screen file with my own.
What goes wrong:
The splash screen is not displayed like it should be - it is being down sampled to an 8 bit image or something weird:
-
The image I'm using
-
The image that gets displayed
It's a bit hard to see depending on your monitor, but on a phone it's reasonably obvious. There are fuzzy greenish lines that appear - basically like the image is being down sampled or the quality worsened.
Any idea what I'm doing wrong, or what might be happening?
Thanks.
Try forcing the app to display images at 32 bits per pixel (instead of the default of 16)
Add an attribute of BitsPerPixel="32" to the app element in WMAppManifest.xml
See http://forums.create.msdn.com/forums/p/85960/520394.aspx#520394
The problem is that the gradient on your splash screen is causing banding, which you can solve by dithering. Robby Ingebretsen has an action for PhotoShop that you can use: http://nerdplusart.com/photoshop-action-for-windows-phone-7-dithering
I suspect the emulator. Run the emulator at full size or run the app on an actual device.
Windows Phone is currently only supporting a color depth of 16bit, causing especially some gradients displaying downsampled for 24bit images. Some first generation firmwares by HTC had a "bug" that also allowed 24bit. Theoretically it is just a registry key, but you cannot commonly change it. Microsoft has limited the color depth to 16bit for the benefit of performance, but as far as I knnow there are some second-generation models without this limitation now.
You may try to downsample the image in Photoshop to 16bit and optimize it for this color depth.

How to install Tom's Terrain Tool for the Unity Game Engine?

I just bought and downloaded Tom's Terrain Tool but I can't find instructions for how to install it. I've looked in the downloaded file - it's a compiled file. I've looked on his website and only find instructions for what to do after it's installed. I've googled around for instructions and can't find them anywhere. In fact, the only file I got with the download is a gzip that extracts into TTT.file. Is that the only thing that was supposed to come with the tool? Why isn't there a readme file with it? Can anyone help me out here? Thanks.
From the installation instructions here:
Created a new terrain
1) Imported a heightmap
2) Calculated the light map
3) Imported all the splatmaps, treemaps, etc. you wish to use into Unity as RGB 24bit textures.
4) If using Unity 2.6, all the textures/maps you intend to use must be set to "readable" in the import settings.
5) If using Unity 3, all the textures/maps must have their Texture Type set to "Advanced" and then checked the "Read/Write
enabled" option.
Once you're installed the Terrain Tools, you will find them in Terrain
=> Tom's Terrain Tools in the Unity editor.
RoyS describes this process in his post here:
Here's the steps I use to get my terrain into Unity.
1 - Generate your L3DT map via the Wizard if you're unfamiliar with
it. Then... File-->Export map-->(select) Heightfield File format -
(pulldown) select "RAW"
-type in a File Name
-check "resize for export"
-1025 size (default) Operations-->Alpha Map-->Alpha Express (png)
The raw is your heightmap and the png is your splatmap. Move those to
your Assets folder.
2 - Make sure "Tom's Terrain Tools" is installed per his instructions.
3 - In Unity Terrain-->Create Terrain Add your 4 textures in Unity as
normal (you can get some nice terrain textures from
http://cgtextures.com ) Terrain-->Import Heightmap RAW
--Bit16
--Windows
Now you should see your heightmap in your first colour chosen. If the
mountains are too high, then go Terrain-->Set Resolution and change
the 600 value. Just change those numbers until you get the desired
height of your mountains and valleys.
Now for the rest of the colour of your terrain.
In Unity, select your png texture in the Project folder and in
Inspector change it to ARGB 32 bit and hit the Apply button. Now you
won't get an error message to change it to 32 bit RBGA as you've just
done it. Now to add the splatmap...
Terrain-->Tom's Terrain Tools-->Splatmap
If you're sand is in your mountain area and your grass under the sea,
then just change the order of your textures until it's right (ie, the
terrain paintbrush textures as if you were painting one from scratch -
the same ones you loaded above).

Resources