custom-controls

Blackberry - how to resize image?

守給你的承諾、 提交于 2019-11-27 04:08:07
I wanted to know if we can resize an image. Suppose if we want to draw an image of 200x200 actual size with a size of 100 x 100 size on our blackberry screen. Thanks Maksym Gontar Just an alternative: BlackBerry - draw image on the screen BlackBerry - image 3D transform You can do this pretty simply using the EncodedImage.scaleImage32() method. You'll need to provide it with the factors by which you want to scale the width and height (as a Fixed32 ). Here's some sample code which determines the scale factor for the width and height by dividing the original image size by the desired size, using

How to place buttons over Image in android?

五迷三道 提交于 2019-11-27 03:55:30
问题 I want to create a custom view like this. I tried the following <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="vertical" > <ImageView android:id="@+id/customView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:src="@drawable/sample_image" /> <Button android:id="@+id/button1"

Custom Control - Clickable link in properties box

橙三吉。 提交于 2019-11-27 03:41:54
问题 I'm making a custom control using C#, and I need to add a link to the property box(so I can show a form once it's clicked). Here's an example: 回答1: You are looking for DesignerVerb. A designer verb is a menu command linked to an event handler. Designer verbs are added to a component's shortcut menu at design time. In Visual Studio, each designer verb is also listed, using a LinkLabel, in the Description pane of the Properties window. You can use a verb for setting value of a single property,

how to create custom tableViewCell from xib

孤者浪人 提交于 2019-11-27 03:34:48
问题 I want to create a custom TableViewCell on which I want to have UITextField with editing possibility. So I created new class with xib. Add TableViewCell element. Drag on it UITextField. Added outlets in my class and connect them all together. In my TableView method cellForRowAtIndexPath I create my custom cells, BUT they are not my custom cells - they are just usual cells. How can I fix this problem, and why it is? thanx! //EditCell. h #import <UIKit/UIKit.h> @interface EditCell :

Styling browser-native video controls

£可爱£侵袭症+ 提交于 2019-11-27 03:11:48
问题 Is it possible to cross-browser style the controls of a browser-native video such as video from HTML5's video tag? I do not understand if it is possible or not, I can't find anything other than this article but it seem uses Javascript. I would like to make the controls bar fit the video width; as you can see from the image attached, the controls bar excedes the video width. HTML for the above image <div class="video centered-content"> <a class="circle-canvas close-video" href="javascript:void

Creating a custom progress bar with images

时光毁灭记忆、已成空白 提交于 2019-11-27 02:59:16
问题 Pretty much what I am trying to do, is create the following image: So this is a progress bar, which will show how many votes the client get in that option. How can I do that? I was wondering if I can use a mask (as I would in flex), but all the masking implementations that I found on the web are doing masks for UIImage s, and not for UIImageView . I cannot do the mask in the UIImage , because the two images have the same dimensions. I have to use the X and Y of the images to crop them?! So,

How do we create a bigger center UITabBar Item

点点圈 提交于 2019-11-27 02:41:19
I am wondering how do we create a bigger center UITabBar like the shot below? Its really beautiful!!!! I recommend you taking a look at the following article. It explains how to customise a tab bar raising the main button. Code: UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(0.0, 0.0, buttonImage.size.width, buttonImage.size.height); [button setBackgroundImage:buttonImage forState:UIControlStateNormal]; [button setBackgroundImage:highlightImage forState:UIControlStateHighlighted]; CGFloat heightDifference = buttonImage.size.height - self.tabBar.frame

How to create a User Control with rounded corners?

一笑奈何 提交于 2019-11-26 23:23:22
问题 I am trying to have a User Control that has rounded corners. It doesnt have a fixed size but it usually doesnt have a width much more than 120 pixels. I need the User Control and its contents(a label and a table) to have rounded edges and look like a round box. I have used this code. [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] private static extern IntPtr CreateRoundRectRgn ( int nLeftRect, // x-coordinate of upper-left corner int nTopRect, // y-coordinate of upper-left corner

Dispatcher throws InvalidOperationException on Messagebox.Show in Textchanged event

佐手、 提交于 2019-11-26 23:20:38
问题 First of all this is the errorlog entry on my error crash program @ 15-9-2011 15:01:30error:System.InvalidOperationException: Dispatcher processing has been suspended, but messages are still being processed. at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) Anyway code: private void TB_postcode_cijfers_TextChanged(object sender, TextChangedEventArgs e){ if (TB_postcode_cijfers.Text != string.Empty || TB_postcode_cijfers

Binding to custom control inside DataTemplate for ItemsControl

喜你入骨 提交于 2019-11-26 23:16:01
I have a problem with bindings for DataTemplate based on defined DataType in ItemsControl , when I want to bind to my custom user control . For demonstration purposes, I've created simple Item class example, where I have collection of items like this: public class Item { public string ItemNameToBeSureWhatPropertyIsBound { get; set; } } In my ViewModel I create such collection, and expose it (with one item for comparison separately): public class MainWindowViewModel : INotifyPropertyChanged { private ObservableCollection<Item> _items; private Item _exampleItem; public MainWindowViewModel() {