I capture a image by camera in emulator and it was saved as:
"/storage/emulated/0/Download/IMG_1582623402006.jpg"
I am trying to display this image in < ImageView > as the following:
Bitmap finalBitmap = BitmapFactory.decodeFile("/storage/emulated/0/Download/IMG_1582623402006.jpg");
holder.image.setImageBitmap(scaledBitmap);
but it shows that "finalBitmap" is empty. What have I missed?
Thanks in advance!
You posted this over a year ago, so it may be too old at this point.
It appears that you are using two variables for your bitmaps: finalBitmap and scaledBitmap and not referencing the proper one in the setImageBitmap command.
Instead, have you tried this?
holder.image.setImageBitmap(finalBitmap);
Not totally sure, but adding some attributes in "options" seems make it work in emulator:
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inScaled = true;
options.inSampleSize = 5;
Bitmap scaledBitmap = BitmapFactory.decodeFile(/storage/emulated/0/Download/IMG_1582623402006.jpg, options);
holder.image.setImageBitmap(scaledBitmap);
I am using the following code in java file and not using resource file.
m_txtSearch = new TextField();
m_txtSearch.setHint("Search");
Then how can i change the font size and color of hint text ?
Can u please help me ?
Font font = new Font("Verdana", Font.BOLD, 12);
txt.setFont(font);
txt.setForeground(Color.BLUE);
I am using CKEditor (v3.6.4) and try to find out how to change the palettes for Text Color and Background Color separately.
I found config.colorButton_colors in the docs which allows me to define the color palette. However, this palette is assigned to both, text and background.
How can I have two different palettes?
The best and easy way is, Include required plugin at the download time or link below
Ckeditor Builder
Yes its actually possible. Just dont pick colors from the config but rather do the following in colorbutton/plugin.js:
var textColors = '1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,' +
'16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,' +
'E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,' +
'D35400,C0392B,BDC3C7,7F8C8D,999,000';
var backgroundColors = 'cee8fe,b1d7ff,c7d3f3,dfd6eb,e4cafe,ffbbff,ffbfd2,ff9999,ffdeb3,ffefb0,f4f98a,ffffbb,d3f1a1,bbffbb,bbffff,a6e3dc,c1ebc7,eddec9,f2ebd3,d3eaf2,e1eff3,ffbe61,ffdc61,e1f29d';
var colors = (type == 'back') ? backgroundColors.split(',') : textColors.split(',');
You can't do that because the color palette is defined for the text color and background.
CKEDITOR.config.colorButton_colors =
'000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,' +
'B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,' +
'F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,' +
'FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,' +
'FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF';
Or you can change the Text Color plugin :)
I want to change the flash color when using element.flash method. By default its yellow.
I was able to increase the number of flash times and delay time in elements.rb file. But i dont know how to change the highlight color.
Any idea on this?
Using different colors to highlight will be helpful if browser elements have yellow background.
Solution
The flashing is based on the element's container's activeObjectHighLightColor. This is set by doing:
element.container.activeObjectHighLightColor = "colour"
Where colour is a valid web-friendly color (as per the container.rb file).
Example - Flash For Individual Element
As an example, here is changing the flash colour for the text field on the Google search:
#Use google search text field as a test page
ie = Watir::Browser.new
ie.goto 'www.google.ca'
e = ie.text_field(:name => 'q')
#Set the flash colour
e.container.activeObjectHighLightColor = "green"
#Flash the object, which should now be green
e.flash
Note:
This will only work with Watir-classic. Watir-webdriver does the flashing differently.
I only tested this in the latest version of watir-classic, but the code for 2.0.4 appears to be the same.
Example - Default Flash Colour
To change the default flash colour for everything, you need to set the activeObjectHighLightColor for the browser.
If you want to change it for the current browser, do:
ie = Watir::Browser.new
ie.activeObjectHighLightColor = "green"
ie.goto 'www.google.ca'
e = ie.text_field(:name => 'q')
e.flash
#=> Will flash green
If you want to change it permanently (ie so you do not have to set it each time), you can change the colour in the ie-class.rb file:
HIGHLIGHT_COLOR = 'yellow'
I am attempting to write an application with MonoTouch. I need to set the background color of the navigation bar. I'd like to set it to orange. This seems like an easy task, but I can't seem to get it to work. Currently, I'm doing the following in the AppDelegate.cs file:
this.window = new UIWindow (UIScreen.MainScreen.Bounds);
this.rootNavigationController = new UINavigationController();
UIColor backgroundColor = new UIColor(74, 151, 223, 255);
this.rootNavigationController.NavigationBar.BackgroundColor = UIColor.Orange;
However, the navigation bar color is still the default color. How do I set the background color of the navigation bar?
You can do this on an ad-hoc basis as Rob described using the TintColor property:
this.rootNavigationController.NavigationBar.TintColor = UIColor.Orange;
Alternatively, you can also set the TintColor for all UINavigationBars at once using the UIAppearance proxy in iOS 5. This is usually done somewhere near DidFinishLaunchingWithOptions method in the AppDelegate:
UINavigationBar.Appearance.TintColor = UIColor.Orange;
You can check out the Apple doc for more detailed information and implementation restrictions:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html
Try changing the TintColor and Translucent properties.