I am having GtkImage to which i want to set visible border like a frame...
so when ever i set any image it will come with default border/frame, which will look good. :)
easiest way is to put the image into GtkFrame widget.
Related
I have got an image 300px300px, but i only want to show 100x100 of it, just like here https://www.pinterest.com/pin/31103053652400980/ background photo is only showing part of it.How can i do that?
You can use UIImageView that has property Clip To Bounds on. After that you can change Content Mode of the `UIImageView' that suits you.
Example:
I am trying to add an orange circle with a number (my number will change depending on certain circumstances) inside it in my WKInterfaceGroup like the image below.
However, it appears you can't change WKInterfaceLabel background color. The only solution I can think of is to add an image behind the label. So how can I achieve this (if it is possible)? Is there another way to make this work?
The easiest way to do this is to:
Put the Label into a Group.
Center Align and Position the layout of the Label
Set the Group to a Fixed Width and Height.
Set the Corner Radius of the Group equal to 1/2 the Width (height should be the same)
Set the Group to Background Color to the color you want.
You could add the label to a WKInterfaceGroup and set its background image property. Or, you can create pre-rendered template images and use setTintColor: to color them.
I need it because the image is small and it's difficult to touch it on the mobile device. So I need to have bigger area of interactable zone but the image should stay small.
I believe the most proper way to make such button is like this:
Create a new Button, remove default child Text.
Set Width and Height of Button as you need for hitzone size.
Add Vertical Layout Group component to the Button.
Set Padding of the Vertical Layout Group to desirable difference between hitzone and visuals.
Remove default Image component. Set alpha of default Image component to zero.
Put your Image as child of Button.
Fix tint: drag (or otherwise set) the child Image to Target Graphic field of Button.
You need to set it up so that the image is inside a button object. Like this:
This way you can have the Button as big as you want and the Image can be any size. If you don't need the Button background image just make the color transparent in the image componenent of the Button object.
A surprisingly better way (in terms of ease and performance) is to add a text child element, even if you already have one. Leave the text empty and resize it however you like. It doesn't add any alpha.
Unity now have Raycast Padding property on Image component, edit these padding values will allow you to have more interactable zone for your button image. Note that you use negative value to extend the click zone.
Image raycast padding
I have a uiimageView containing the text like this.
I want to set the image background of the text to look like this instead.
Please help me! Thanks!
You will need to combine an image of the text with the background image (the stuff that is supposed to fill the inside of the text) using compositing. Take a look at the various blend modes you can use, or look into the use of CIFilter.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGBlendMode
https://developer.apple.com/library/mac/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html
The thing in the background looks like it might be a gradient. Again, you can use a CIFilter to generate that gradient, or you can use Core Graphics. So you'll composite the drawn text with its fill image, then you'll draw that over a gradient.
instead of text in black solid color, make image with transparent text and outer region as the grey gradient you want and put this image over you background image, you will get the desired result.
alt text http://www.imagechicken.com/uploads/tn1270646423002339600.png
I want to draw like that.
How do I draw like that? Do I use Quartz-core?
please advice for me.
If you already have the image, then set it as the background will solve your issue. Don't need to use Quartzcore, you can create a text field, or a label or a button with the background as your image. And you are all set!