Are dpi and pixel in Photoshop are just the same? - pixel

This one bothers me, I'm still new on Android UI designing. Are dpi and pixel in Photoshop are just the same?
Like if I will create a xhdpi with 320dpi, the 320dpi is just the same settings on 320 pixels/inch resolution?
Because when I designed for example an icons like launcher icon 96x96 xhdpi, my settings on resolution is 320 pixels/inch resolution on Photoshop. Then I will just resize the image thru image resizing on resolution. (example: The 320 resolution for xhdpi will be change to 240 for hdpi) Is this correct?

Nope, for Photoshop, they are different. If you wanna design for Android, you have to provide 4 different files of the same asset: ldpi, mdpi, hdpi and xdpi. They differ at dimension. You can take a look at http://developer.android.com/guide/practices/screens_support.html.
In my opinion, a vector program like Illu or Inkscape will do the job better: dpi in Android and export dpi are the same. Create your UI at 72 screen dpi, export with different dpi after that.

Related

Visual Studio / MFC: BMP fills Picture Control on desktop, but is too small on my laptop

I have a number of dialogs with Picture Controls. On my Win10 desktop, the BMP correctly fills the entire picture control, but on my Win10 laptop the BMP only fills about 2/3 of the picture control.
If I change Windows 10 "Scale and layout" setting from say 100% to 125% on both my desktop and laptop, then the dialog and BMP both get bigger/smaller, but the same problem exists: the BMP is significantly smaller than the control on my laptop.
In the Picture Control properties, Image is set to an IDB bitmap resource, and Type=Bitmap.
Is there an easy fix for this?
If you look here:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb760773(v=vs.85).aspx
You will see the following quote:
SS_REALSIZEIMAGE is always used in conjunction with SS_ICON.
You need to change your resource setting because yours is not an icon. That article also states:
SS_REALSIZECONTROL
Adjusts the bitmap to fit the size of the static control. For example, changing the locale can change the system font, and thus controls might be resized. If a static control had a bitmap, the bitmap would no longer fit the control. This style bit dictates automatic redimensioning of bitmaps to fit their controls.
If SS_CENTERIMAGE is specified, the bitmap or icon is centered (and clipped if needed). If SS_CENTERIMAGE is not specified, the bitmap or icon is stretched or shrunk.
Note that the redimensioning in the two axes are independent, and the result may have a changed aspect ratio.

manage images issue Swift

I have a problem to understand how do I manage the various image resolution in iOS with Swift.
For example if I have an image that i use it in my app , I have to create to for various devices resolution , but after that I insert in my project the various image resolution where I have to insert it, in a special folder?.
Can you help me?
You can simply drag your images with different resolutions from finder to the Asset Catalog in Xcode.
First, you need to understand why images with 1x, 2x, and 3x resolutions are needed.
Some devices' screen have denser pixels than others. These devices have what is called "Retina Displays". Imagine that you want to display a 100px by 100px image on a normal display. Now imagine that the same image is displayed on a display where the pixels are more closely packed. Obviously, the image on the second display will appear smaller. That's not a very good user experience.
To solve this problem, you can provide 2x and 3x images. The operating system will automatically choose to use these images whenever the display is a retina display.
Now let's see how you can put the images into Xcode.
First open your asset catalog:
q
Then drag the image that you want to add to this panel:
Then you will see that your image is added:
Now do you see those 1x 2x 3x thingys? That's where you need to drag the images with higher resolutions to!
So here I dragged a 2x image to the 2x slot:
Now when your app runs on a device with retina display, the 2x image will be used!
It's rather not for image resolution but screen's pixel density. Basically you've got non-retina devices (standard) and retina ( 2xstandard and 3xstandard). So, in example if you've got 100x100 point imageView that you would like to feed with image named square.png asset you will need 3 kind of images: square.png (100x100px), square#2x.png (200x200px) and square#3x.png (300x300px).
In Xcode, put these images in something called Asset Catalog - it will handle images' size managing for you.
More info: https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/_index.html

Blurry charts with abcpdf

I'm trying to export an HTML page to PDF with ABCpdf. The text converts OK but the charts are very blurry. I've tried increasing the font size and it helps very little. What could be the solution?
EDIT: I'm using the asp.net charts if that helps.
You'll need to output the charts at a higher DPI. Not sure if you can do this with abcpdf though.
I am assuming your chats are images? If so the reason for the blur is that the DPI on the HTML image is 72 DPI and the DPI of the rendered pdf is 300 DPI.
The only way I know round this is to have the images in the HTML a much higher resolution (300 DPI) then reduce the size with a set height and width on the page. When ABCPdf imports the image it will download the source and look much nicer.
Other answers are on the right track, but not quite there.
The browser "usually" displays things at 96 DPI. This depends on settings but we're pretty safe to assume here. The PDF is going to scale to 72 DPI. So you need your Rect to be set to 3/4 the browser width. Then your images will look correct.
As a side effect you may end up needing a higher resolution image in order to get the size you want (you can increase the resolution of an image by the inverse, i.e. by a factor of 4/3 to achieve parity with what you'd see in a browser).
Using the code below, your images will never blur (though you may need to adjust your expected document width; a PDF with a width of 612pt # 72 DPI (letter-sized portrait orientation, for example) needs to be backed by a browser width of 816px # 96 DPI):
const Double pdfDpi = 72;
const Double browserDpi = 96;
var browserToPdfDpiRatio = BrowserDpi / PdfDpi;
pdf.HtmlOptions.BrowserWidth = (Int32)Math.Round(pdf.Rect.Width * browserToPdfDpiRatio, 0);

set ios screen resolution in xcode4 storyboard

Am working on an ipod/iphone application that primarily captures a photo. Am designing the flow in xcode4 IB storyboard.
However, as you can see from the image it is taking the default resolution as 320x480 which causing the preview on ipod retina display to show up in a corner than full screen. How can I make the IB get device resolution and adjust the ratio accordingly?
I tried looking at project settings, build settings, info.plist however couldn't find an answer yet.
Thx
Those dimensions are in points, not pixels. They are correct. On retina displays, 320 points are equal to 640 pixels. If your application is only showing up in a quarter of the screen, it's likely the problem is in your code, not in how you have set things up in Interface Builder.

How to position/resize VB6 controls for different dpi settings?

In a VB form, I am placing controls(image controls), like a banner image, a logo in an image, and a an image list for an animated circle to representing processing.
When I position these controls at 96 dpi, they are perfect. But once the dpi setting is changed to 120dpi, the controls get resized and repositioned.
How do have the same positions of the controls, over different dpi settings?
ActiveResize is a great tool for resizing controls automagically. It costs money, but it's definitely worth checking out.

Resources