How to set a picture programmatically in a NavBar?

You can set backGround image to navigationBar Using this Put in didFinishLaunchingWithOptions [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@”title_bar.png”] forBarMetrics:UIBarMetricsDefault]; Or you can set navigation bar image in any view using UINavigationBar *navBar = [[self navigationController] navigationBar]; UIImage *image = [UIImage imageNamed:@”TopBar.png”]; [navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault]; Or you can set a view on your NavigationBar Link [[UINavigationBar appearance] addSubview:yourView]; … Read more

How to use the new Material Design Icon themes: Outlined, Rounded, Two-Tone and Sharp?

Update (31/03/2019) : All icon themes work via Google Web Fonts now. As pointed out by Edric, it’s just a matter of adding the google web fonts link in your document’s head now, like so: <link href=”https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp” rel=”stylesheet”> And then adding the correct class to output the icon of a particular theme. <i class=”material-icons”>donut_small</i> <i … Read more

How can I save HICON to an .ico file?

You can save HICONs with the IPicture::SaveAsFile() method. Here’s a sample C++ program that uses it: #include “stdafx.h” #include <windows.h> #include <olectl.h> #pragma comment(lib, “oleaut32.lib”) HRESULT SaveIcon(HICON hIcon, const wchar_t* path) { // Create the IPicture intrface PICTDESC desc = { sizeof(PICTDESC) }; desc.picType = PICTYPE_ICON; desc.icon.hicon = hIcon; IPicture* pPicture = 0; HRESULT hr … Read more

Change icons of checked and unchecked for Checkbox for Android

Kind of a mix: Set it in your layout file :- <CheckBox android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”new checkbox” android:background=”@drawable/checkbox_background” android:button=”@drawable/checkbox” /> where the @drawable/checkbox will look like: <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:state_checked=”true” android:state_focused=”true” android:drawable=”@drawable/checkbox_on_background_focus_yellow” /> <item android:state_checked=”false” android:state_focused=”true” android:drawable=”@drawable/checkbox_off_background_focus_yellow” /> <item android:state_checked=”false” android:drawable=”@drawable/checkbox_off_background” /> <item android:state_checked=”true” android:drawable=”@drawable/checkbox_on_background” /> </selector>

HTML5 i tag validity with icons

Don’t use i. The i element has a meaning which isn’t appropriate for general icons: […] a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another … Read more

How to add an image to a JFrame title bar?

Since JPanel doesn’t have a title bar, I’m assuming that you’re referring to JFrame. That being said, use setIconImage(…). Here is an example of using setIconImages(). import java.awt.Image; import javax.swing.*; import javax.imageio.ImageIO; import java.net.URL; import java.util.*; class FrameIcons { public static void main(String[] args) throws Exception { URL url16 = new URL(“http://i.stack.imgur.com/m0KKu.png”); URL url32 = … Read more