public void ImageIconSourceTest() { ImageIconSource iconSource = null; var uri = new Uri("ms-appx:///Assets/Nuclear_symbol.svg"); RunOnUIThread.Execute(() => { iconSource = new ImageIconSource(); // IconSource.Foreground should be null to allow foreground inheritance from // the parent to work. Verify.AreEqual(iconSource.Foreground, null); Log.Comment("Validate the defaults match BitmapIcon."); var icon = new ImageIcon(); Verify.AreEqual(icon.Source, iconSource.ImageSource); Log.Comment("Validate that you can change the properties."); iconSource.Foreground = new SolidColorBrush(Windows.UI.Colors.Red); iconSource.ImageSource = new SvgImageSource(uri); }); IdleSynchronizer.Wait(); RunOnUIThread.Execute(() => { Verify.IsTrue(iconSource.Foreground is SolidColorBrush); Verify.AreEqual(Windows.UI.Colors.Red, (iconSource.Foreground as SolidColorBrush).Color); Verify.AreEqual(uri, ((SvgImageSource)iconSource.ImageSource).UriSource); }); }
override public void UpdateUIComponents(Ray rCastRay, bool inputValid, Collider parentCollider) { bool bButtonsAvailable = m_CurrentPageFlipState == PageFlipState.Standard; //update sketch icons for (int i = 0; i < m_Icons.Length; ++i) { bool bThisIconActive = false; ImageIcon rIcon = m_Icons[i]; if (bButtonsAvailable && rIcon.m_Valid && BasePanel.DoesRayHitCollider(rCastRay, rIcon.m_IconScript.GetCollider())) { bool bWasButtonPressed = rIcon.m_IconScript.IsPressed(); rIcon.m_IconScript.UpdateButtonState(inputValid); if (rIcon.m_IconScript.IsPressed() && !bWasButtonPressed) { //on press, refresh the buttons RefreshPage(); } bThisIconActive = true; } if (!bThisIconActive) { //reset state of button because we're not messing with it rIcon.m_IconScript.ResetState(); } } base.UpdateUIComponents(rCastRay, inputValid, parentCollider); }
public void SetCurrentImage(bool isCheck) { this.isCheck = isCheck; this.imageWidget.Image = !isCheck?ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.unLock.png") : ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.lock.png"); Services.EventsService.GetEvent <ScaleLockedChangeEvent>().Publish(isCheck); }
private void loadImageOfUser(string paramString) { string str = DatabaseDBUtil.Properties.ConnectionHost; if (this.imgcIcon == null && !string.ReferenceEquals(str, null)) { if (DatabaseDBUtil.Enterprise) { if (!str.StartsWith("http://", StringComparison.Ordinal) && !str.StartsWith("https://", StringComparison.Ordinal)) { str = "http://" + str; } string str1 = str + "/ces/pictures/showAvatar?userId=" + DatabaseDBUtil.Properties.UserId; try { BufferedImage bufferedImage1 = ImageIO.read((new URL(str1)).openStream()); BufferedImage bufferedImage2 = ImageUtils.resizeImage(bufferedImage1, 1, 12, 12); this.imgcIcon = new ImageIcon(bufferedImage2); } catch (Exception) { this.imgcIcon = new ImageIcon(); } } else { this.imgcIcon = new ImageIcon(); } } if (this.imgcIcon != null) { ((JideButton)this.o_trailingButton).Icon = this.imgcIcon; } }
void OnTriggerEnter(Collider other) { if (other.tag == "Directory") { direct = other.GetComponent<Directory>(); direct.RightArmIn = true; } if (other.tag == "Back") { other.gameObject.SendMessage("Backward"); } if (other.tag == "Image") { img = other.GetComponent<ImageIcon>(); img.RightArmIn = true; imge = other.gameObject; } if (other.tag == "ImageViewer") { imge.gameObject.SendMessage("Stop"); } if (other.tag == "Presentation") { present = other.GetComponent<PresentationIcon>(); present.RightArmIn = true; } if (other.tag == "Car Presentation") { networkScript = GameObject.Find("AppManager").GetComponent<NetworkScript2>(); //networkScript.isLevelToLoadReceived = false; Application.LoadLevel(2); } if(other.tag == "Close"){ imageIcon = GameObject.Find("Image Icon(Clone)").GetComponent<ImageIcon>(); Invoke("InvokeClose", 1.0f); } if(other.tag == "Chart"){ startPos = new Vector3 (transform.position.x, transform.position.y, transform.position.z); isSizeChanged = false; Debug.Log(startPos); } if (other.tag == "Controlled") { TakeP = other.GetComponent<TakenParametrs>(); defaulted = transform.eulerAngles.y; defaultAngle = other.transform.eulerAngles.y; TakeP.fstfinger = true; renderer.material.color = Color.green; } if(other.tag == "ChartClose"){ Debug.Log("CloseChart-----------------------------"); Invoke("InvokeCloseChart", 1.0f); } }
public static Icon convertToGrayScale(ImageIcon paramImageIcon) { Image image = paramImageIcon.Image; BufferedImage bufferedImage = createBufferedImage(image, 1, image.getWidth(null), image.getHeight(null)); return(new ImageIcon(convertToGrayscale(bufferedImage))); }
override public void Init(GameObject rParent, string sText) { if (m_CurrentState == State.Uninitialized) { //create buttons for worst case m_IconCountFullPage = m_IconGridHeightFullPage * m_IconGridWidthFullPage; m_Icons = new ImageIcon[m_IconCountFullPage]; var xfWithUniformScale = TrTransform.FromTransform(transform); xfWithUniformScale.scale = transform.localScale.x; Vector3 vBaseIconPosition = xfWithUniformScale * m_BaseButtonOffset; for (int y = 0; y < m_IconGridHeightFullPage; ++y) { for (int x = 0; x < m_IconGridWidthFullPage; ++x) { int iIndex = (m_IconGridWidthFullPage * y) + x; m_Icons[iIndex] = new ImageIcon(); m_Icons[iIndex].m_Icon = Instantiate(m_ButtonPrefab); m_Icons[iIndex].m_IconScript = m_Icons[iIndex].m_Icon.GetComponent <BaseButton>(); InitIcon(m_Icons[iIndex]); //scale icon for pop-up, and then late-init it so the scale is cached correctly Vector3 vIconScale = m_Icons[iIndex].m_Icon.transform.localScale; vIconScale.Set(m_ButtonWidth, m_ButtonWidth, m_ButtonWidth); vIconScale *= transform.localScale.x; m_Icons[iIndex].m_Icon.transform.localScale = vIconScale; m_BaseIconScale = vIconScale.x; Vector3 vPos = vBaseIconPosition; vPos += (transform.right * (float)x * m_IconSpacing * transform.localScale.x); vPos += (-transform.up * (float)y * m_IconSpacing * transform.localScale.x); m_Icons[iIndex].m_Icon.transform.position = vPos; m_Icons[iIndex].m_Icon.transform.rotation = transform.rotation; m_Icons[iIndex].m_Icon.transform.parent = transform; // Register after parent has been assisgned. m_Icons[iIndex].m_IconScript.RegisterComponent(); } } //default to first page highlighted m_PageIndex = 0; m_BaseIndex = 0; if (m_DataCount <= m_IconCountFullPage) { m_NumPages = 1; } else { m_NumPages = ((m_DataCount - 1) / m_IconCountNavPage) + 1; } } //base modifies scale, so we want to do this after we create our icons base.Init(rParent, sText); RefreshPage(); }
public ColorImage() { this.imageWidget = new ImageView(); this.imageWidget.WidthRequest = 15; this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.Arrow.png"); this.Add((Widget)this.imageWidget); this.ShowAll(); }
public static void setApplicationIcons(ImageIcon paramImageIcon1, ImageIcon paramImageIcon2, ImageIcon paramImageIcon3) { backstageNormal = new ImageIcon(typeof(org.officelaf.ribbon.OfficeRibbonUI).getResource("images/backstage_arrow.png")); backstageOver = new ImageIcon(typeof(org.officelaf.ribbon.OfficeRibbonUI).getResource("images/backstage_arrow_selected.png")); backstageDown = backstageOver; normal = paramImageIcon1; over = paramImageIcon2; down = paramImageIcon3; }
public virtual JLabel getJLabel() { if (this.image == null) { return(null); } ImageIcon.__ <clinit>(); ImageIcon imageIcon = new ImageIcon(this.image); return(new JLabel(imageIcon)); }
private void InitButtonPixbuf() { this.filter_button.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ResourcePanelResource.search.png"); this.clear_button.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ResourcePanelResource.Close.png"); Gdk.Color backGroundColor = this.filter_button.ImageWidget.BackGroundColor; Gdk.Color focusBackGroundColor = this.filter_button.ImageWidget.FocusBackGroundColor; this.filter_button.ImageWidget.BackGroundColor = focusBackGroundColor; this.filter_button.ImageWidget.FocusBackGroundColor = backGroundColor; this.clear_button.ImageWidget.BackGroundColor = focusBackGroundColor; this.clear_button.ImageWidget.FocusBackGroundColor = backGroundColor; }
public virtual ImageIcon getDisabledImageIcon(int paramInt) { ImageIcon imageIcon = (ImageIcon)this.o_disabledImages[Convert.ToInt32(paramInt)]; if (imageIcon == null) { imageIcon = ImageUtils.convertToGrayScale(getTableImage(paramInt)); this.o_disabledImages[Convert.ToInt32(paramInt)] = imageIcon; } return(imageIcon); }
private ImageIcon createIconWithBackground(string paramString, Color paramColor) { ImageIcon imageIcon = createIcon(paramString); BufferedImage bufferedImage = new BufferedImage(imageIcon.IconWidth, imageIcon.IconHeight, 1); Graphics2D graphics2D = bufferedImage.createGraphics(); graphics2D.Color = paramColor; graphics2D.fillRect(0, 0, bufferedImage.Width, bufferedImage.Height); graphics2D.drawImage(imageIcon.Image, 0, 0, null); graphics2D.dispose(); return(new ImageIcon(bufferedImage)); }
public new void Init(string imageUnCheck, string imageCheck, int tag) { this.ImageCheck = imageCheck; this.ImageUnCheck = imageUnCheck; this.Tag = tag; this.checkedImage = ImageIcon.GetIcon(imageCheck); this.uncheckedImage = ImageIcon.GetIcon(imageUnCheck); this.imageWidget.Image = this.uncheckedImage; this.imageWidget.WidthRequest = 24; this.imageWidget.HeightRequest = 24; this.imageWidget.Show(); }
public virtual void refreshTrailingButton() { if (this.o_trailingButton == null) { return; } if (DatabaseDBUtil.Loaded) { this.imgcIcon = null; ((JideButton)this.o_trailingButton).Text = DatabaseDBUtil.Properties.UserAndRolesData.PrincipalsData.Name; loadImageOfUser(DatabaseDBUtil.Properties.UserId); } }
public void Initialize() { //numUniqueMaps = MapScroller.NUM_UNIQUE_MAPS_PER_MILE; numUniqueMaps = MapScroller.NUM_MAPS_PER_MILE / 2; for (int i = 0; i < numUniqueMaps; i++) { ImageIcon imageIcon = Instantiate(levelIconPrefab, levelIconContainer) as ImageIcon; // remember to set sprite later! this.levelIcons.Add(imageIcon); } this.SetLevelIconHighlight(-1); this.UpdateLevelText(); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static String uploadServerPicture(byte[] paramArrayOfByte, String paramString) throws Exception public static string uploadServerPicture(sbyte[] paramArrayOfByte, string paramString) { File file1 = new File(SERVER_PICTURE_DB_FOLDER); if (!file1.exists()) { file1.mkdirs(); } string str = paramString + ".png"; File file2 = new File(file1 + File.separator + str); ImageIcon imageIcon = ImageUtils.base64ToImage(paramArrayOfByte); ImageUtils.saveImage(ImageUtils.toBufferedImage(imageIcon.Image), file2.AbsolutePath, 1); return(str); }
public Widget ResolveEditor(PropertyItem item = null) { this._table = new Table(2u, 1u, false); this._checkButton = new CheckButtonEx(); this._checkButton.Label = "九宫格"; this._sudukuTable = new Table(2u, 2u, false); this._tableRight = new Table(3u, 1u, false); this._tableBottom = new Table(1u, 3u, false); this._left = new EntryIntEx(); this._left.Name = "left"; this._right = new EntryIntEx(); this._right.Name = "right"; this._top = new EntryIntEx(); this._top.Name = "top"; this._bottom = new EntryIntEx(); this._bottom.Name = "bottom"; this._left.WidthRequest = (this._right.WidthRequest = (this._top.WidthRequest = (this._bottom.WidthRequest = 30))); this._left.IntegerNum = (this._right.IntegerNum = (this._top.IntegerNum = (this._bottom.IntegerNum = 0))); this._imageWidget = new ImageView(); this._imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.ComponentResource.Multi.png"); this._tableRight.Attach(this._top, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); Label label = new Label(); label.WidthRequest = 5; this._tableRight.Attach(label, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Expand, 0u, 0u); this._tableRight.Attach(this._bottom, 0u, 1u, 2u, 3u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._tableRight.ShowAll(); this._tableBottom.Attach(this._left, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); Label label2 = new Label(); label2.WidthRequest = 5; this._tableBottom.Attach(label2, 1u, 2u, 0u, 1u, AttachOptions.Fill, AttachOptions.Expand, 0u, 0u); this._tableBottom.Attach(this._right, 2u, 3u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._tableBottom.ShowAll(); this._sudukuTable.Attach(this._imageWidget, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.Attach(this._tableRight, 1u, 2u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.Attach(this._tableBottom, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._sudukuTable.ShowAll(); this._table.Attach(this._checkButton, 0u, 1u, 0u, 1u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._table.Attach(this._sudukuTable, 0u, 1u, 1u, 2u, AttachOptions.Fill, AttachOptions.Fill, 0u, 0u); this._table.ShowAll(); this._left.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._right.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._top.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._top.EntryValueChanged += new EventHandler <EntryIntEventArgs>(this.EntryValueChanged); this._checkButton.Clicked += new EventHandler(this._checkButton_Clicked); return(this._table); }
public ImageCombox() { this.imageWidget = new ImageView(); this.imageWidget.WidthRequest = 10; this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.Arrow.png"); this.Add((Widget)this.imageWidget); CheckMenuItem checkMenuItem1 = new CheckMenuItem(string.Format("%{0}", (object)LanguageInfo.Property_ParentPercentage)); checkMenuItem1.ButtonPressEvent += new ButtonPressEventHandler(this.item1_ButtonPressEvent); CheckMenuItem checkMenuItem2 = new CheckMenuItem(LanguageInfo.NewFile_Pixel); checkMenuItem2.ButtonPressEvent += new ButtonPressEventHandler(this.item2_ButtonPressEvent); this._contentMenu.Add((Widget)checkMenuItem1); this._contentMenu.Add((Widget)checkMenuItem2); this.ShowAll(); }
public void ImageIconTest() { ImageIcon imageIcon = null; var uri = new Uri("ms-appx:///Assets/Nuclear_symbol.svg"); RunOnUIThread.Execute(() => { imageIcon = new ImageIcon(); /* #3949 is created to re-enable this part * This is an unparented ImageIcon, so looking up the default foreground and verifying * is a bit wierd. The colors are also chaning, so this is going to fail with those changes * So commenting this check out for now to make the test more resilient. * * var theme = Application.Current.RequestedTheme; * if (theme == ApplicationTheme.Dark) * { * Verify.AreEqual(((SolidColorBrush)imageIcon.Foreground).Color, Colors.White); * } * else * { * Verify.AreEqual(((SolidColorBrush)imageIcon.Foreground).Color, Colors.Black); * } */ Log.Comment("Validate that you can change the properties."); imageIcon.Foreground = new SolidColorBrush(Windows.UI.Colors.Red); imageIcon.Source = new SvgImageSource(uri); Content = imageIcon; Content.UpdateLayout(); }); IdleSynchronizer.Wait(); RunOnUIThread.Execute(() => { Verify.IsTrue(imageIcon.Foreground is SolidColorBrush); Verify.AreEqual(Windows.UI.Colors.Red, (imageIcon.Foreground as SolidColorBrush).Color); Verify.AreEqual(uri, ((SvgImageSource)imageIcon.Source).UriSource); if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5)) { var image = ((Image)VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(imageIcon, 0), 0)); Verify.IsTrue(image.IsLoaded); } }); }
public static Xwt.Drawing.Image GainImage(string imageName) { string str = Path.Combine(GuideXMLHelp.FilePath, imageName); try { if (File.Exists(str)) { return(ImageIcon.GetIconFromFile(str)); } } catch { return((Xwt.Drawing.Image)null); } return((Xwt.Drawing.Image)null); }
private void Init() { try { string strTitle = string.Format("{0} —— ", CurrentApp.GetLanguageInfo("2102016", "Screen Monitor")); if (MonitorData != null) { mMonitorItem = MonitorItem.CreateItem(MonitorData); mMonitorItem.CurrentApp = CurrentApp; mMonitorItem.ListUserParams = ListUserParams; mMonitorObject = new MonitorObject(); mMonitorObject.MonType = MonitorType.MonScr; mMonitorObject.ObjID = MonitorData.ObjID; mMonitorObject.ObjType = MonitorData.ObjType; mMonitorObject.ObjValue = MonitorData.Name; mMonitorObject.Role = 2; string strOther03 = MonitorData.Other03; if (!string.IsNullOrEmpty(strOther03)) { string[] arrOther03 = strOther03.Split(new[] { ';' }, StringSplitOptions.None); if (arrOther03.Length > 1) { mMonitorObject.Other03 = arrOther03[1]; } else if (arrOther03.Length > 0) { mMonitorObject.Other03 = arrOther03[0]; } } mMonitorItem.ScreenChanMonObject = mMonitorObject; Dispatcher.Invoke(new Action(mMonitorItem.UpdateState)); DataContext = mMonitorItem; strTitle += mMonitorItem.Name; ImageIcon.SetResourceReference(StyleProperty, string.Format("NMonImageIcon{0}Style", mMonitorItem.ObjType)); InitMonitorClient(); } TxtObjListTitle.Text = strTitle; } catch (Exception ex) { ShowException(ex.Message); } }
public void Refresh() { if (this._propertyItem != null) { this.resourceFile = (this._propertyDescriptor.GetValue(this._propertyItem.Instance) as ResourceFile); string arg; if (this._propertyItem.ResourceFilterDescriptor == null) { arg = ".png,jpg"; } else { arg = string.Join(",", this._propertyItem.ResourceFilterDescriptor.FileFilter); } if (this.resourceFile != null) { if (this.resourceFile.IsDefault) { this.imageWidget.TooltipText = string.Format("{0}{1}", LanguageInfo.Display_SupportFileTypes, arg); } else { this.imageWidget.TooltipText = string.Format("{0}{1}\r\n{2}", LanguageInfo.Display_SupportFileTypes, arg, this.resourceFile.FullPath); } Xwt.Drawing.Image image = (this.resourceFile.PreviewImageInfo == null) ? null : this.resourceFile.PreviewImageInfo.Image; if (image != null) { double width = this.resourceFile.PreviewImageInfo.Size.Width; double height = this.resourceFile.PreviewImageInfo.Size.Height; this.ScaleImage(image); if (this._propertyDescriptor.Name == "LabelAtlasFileImage_CNB") { this._propertyItem.Instance.GetType().GetProperty("CharWidth").SetValue(this._propertyItem.Instance, (int)(width / 12.0), null); this._propertyItem.Instance.GetType().GetProperty("CharHeight").SetValue(this._propertyItem.Instance, (int)height, null); } } } else { this.imageWidget.TooltipText = string.Format("{0}{1}", LanguageInfo.Display_SupportFileTypes, arg); this.imageWidget.Image = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.NormalImage.png"); this.imageWidget.QueueDraw(); } } }
public static byte[] ToIcon(this string comment, int width, int height, ImageIcon _icon) { byte[] result; if (comment != null && comment.Length > 0) { switch (_icon) { case ImageIcon.Camera: result = Convert.FromBase64String(_camera_green); break; case ImageIcon.Comment: result = Convert.FromBase64String(_comment_blue); break; default: result = Convert.FromBase64String(_alert_image); break; } } else { switch (_icon) { case ImageIcon.Camera: result = Convert.FromBase64String(_camera_black); break; case ImageIcon.Comment: result = Convert.FromBase64String(_comment_black); break; default: result = Convert.FromBase64String(_alert_image); break; } } using (var stream = new MemoryStream()) { Transparent2Color(ResizeImage(result, width, height), Color.White).Save(stream, ImageFormat.Png); return(stream.ToArray()); } }
private void PrepareOpenWithFlyoutApps() { MenuFlyoutOpenWith.Items.Clear(); for (int i = 0; i < ViewModel.OpenWithApps.Count; i++) { OpenWithApp app = ViewModel.OpenWithApps[i]; if (app.Logo != null) { var icon = new ImageIcon { Source = app.Logo, Scale = new System.Numerics.Vector3(3), CenterPoint = new System.Numerics.Vector3(app.Logo.PixelWidth / 2) }; var item = new MenuFlyoutItem { Text = app.AppInfo.DisplayInfo.DisplayName, Icon = icon, Command = ViewModel.OpenWithCommand, CommandParameter = i.ToString() }; MenuFlyoutOpenWith.Items.Add(item); } else { var item = new MenuFlyoutItem { Text = app.AppInfo.DisplayInfo.DisplayName, Command = ViewModel.OpenWithCommand, CommandParameter = i.ToString() }; MenuFlyoutOpenWith.Items.Add(item); } } MenuFlyoutOpenWith.Items.Add(MenuFlyoutItemStore); MenuFlyoutOpenWith.Items.Add(new MenuFlyoutSeparator()); MenuFlyoutOpenWith.Items.Add(MenuFlyoutItemAllApps); }
private void InitiaFileType() { this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.sence.png"), "Scene", EFileType.Scene, ".csd", LanguageInfo.NewFile_Scene) { Description = LanguageInfo.NewFile_SceneDes }, 0, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.layer.png"), "Layer", EFileType.Layer, ".csd", LanguageInfo.NewFile_Layer) { Description = LanguageInfo.NewFile_LayerDes }, 1, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.node.png"), "Node", EFileType.Node, ".csd", LanguageInfo.Display_Component_Entity) { Description = LanguageInfo.NewFile_NodeDes }, 2, null); this.SetWigetPropeties(new FileTypeInfo(ImageIcon.GetIcon("CocoStudio.ControlLib.Resource.plist.png"), "Plist", EFileType.Plist, ".csi", LanguageInfo.NewFile_Plist) { Description = LanguageInfo.NewFile_PlistDes }, 3, null); base.ShowAll(); }
public FilpEditorWidget() { this.alignment1 = new Alignment(0.5f, 0.5f, 1f, 1f); this.alignment1.Name = "alignment1"; this.table1 = new Table(1U, 2U, false); this.table1.Name = "table1"; this.table1.ColumnSpacing = 6U; this.btnS = new ToggleButtonImage(); this.btnS.CheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.horizontalFilp.png"); this.btnS.UnCheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.horizontalFilp.png"); this.btnS.CanFocus = true; this.btnS.Name = "btnS"; this.btnS.SetSizeRequest(22, 22); this.table1.Add((Widget)this.btnS); Table.TableChild tableChild1 = (Table.TableChild) this.table1[(Widget)this.btnS]; tableChild1.XOptions = AttachOptions.Fill; tableChild1.YOptions = AttachOptions.Fill; this.btnV = new ToggleButtonImage(); this.btnV.CheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.verticalFilp.png"); this.btnV.UnCheckedImage = ImageIcon.GetIcon("CocoStudio.DefaultResource.EditorResource.verticalFilp.png"); this.btnV.CanFocus = true; this.btnV.Name = "btnV"; this.btnV.SetSizeRequest(22, 22); this.table1.Add((Widget)this.btnV); Table.TableChild tableChild2 = (Table.TableChild) this.table1[(Widget)this.btnV]; tableChild2.LeftAttach = 1U; tableChild2.RightAttach = 2U; tableChild2.XOptions = AttachOptions.Fill; tableChild2.YOptions = AttachOptions.Fill; this.alignment1.Add((Widget)this.table1); this.Add((Widget)this.alignment1); if (this.Child != null) { this.Child.ShowAll(); } this.Hide(); this.ReadLanuageConfigFile(); this.btnS.CheckChanged += new EventHandler(this.btnS_Clicked); this.btnV.CheckChanged += new EventHandler(this.btnV_Clicked); }
public void ImageIconTest() { ImageIcon imageIcon = null; var uri = new Uri("ms-appx:///Assets/Nuclear_symbol.svg"); RunOnUIThread.Execute(() => { imageIcon = new ImageIcon(); var theme = Application.Current.RequestedTheme; if (theme == ApplicationTheme.Dark) { Verify.AreEqual(((SolidColorBrush)imageIcon.Foreground).Color, Colors.White); } else { Verify.AreEqual(((SolidColorBrush)imageIcon.Foreground).Color, Colors.Black); } Log.Comment("Validate that you can change the properties."); imageIcon.Foreground = new SolidColorBrush(Windows.UI.Colors.Red); imageIcon.Source = new SvgImageSource(uri); Content = imageIcon; Content.UpdateLayout(); }); IdleSynchronizer.Wait(); RunOnUIThread.Execute(() => { Verify.IsTrue(imageIcon.Foreground is SolidColorBrush); Verify.AreEqual(Windows.UI.Colors.Red, (imageIcon.Foreground as SolidColorBrush).Color); Verify.AreEqual(uri, ((SvgImageSource)imageIcon.Source).UriSource); if (PlatformConfiguration.IsOsVersionGreaterThanOrEqual(OSVersion.Redstone5)) { var image = ((Image)VisualTreeHelper.GetChild(VisualTreeHelper.GetChild(imageIcon, 0), 0)); Verify.IsTrue(image.IsLoaded); } }); }
void OnTriggerExit(Collider other) { if (other.tag == "ImageViewer") { number++; imged = GameObject.FindWithTag("Image"); imgicon = imged.gameObject.GetComponent <ImageIcon>(); Debug.Log("insrt " + (number / 2 + 1)); if (number / 2 + 1 == imgicon.imageList.Count) { number = 0; Invoke("stop", 0.5f); } if (other.transform.position.y > 4.0f) { other.rigidbody.isKinematic = false; other.rigidbody.AddForce(0, -1500.0f, 0); other.gameObject.SendMessage("Stopped"); } } }
void OnTriggerExit(Collider other) { if (other.tag == "ImageViewer") { number++; imged = GameObject.FindWithTag("Image"); imgicon = imged.gameObject.GetComponent<ImageIcon>(); Debug.Log("insrt " + (number/2+1)); if (number/2+1 == imgicon.imageList.Count) { number = 0; Invoke("stop", 0.5f); } if (other.transform.position.y > 4.0f) { other.rigidbody.isKinematic = false; other.rigidbody.AddForce(0,-1500.0f,0); other.gameObject.SendMessage("Stopped"); } } }
public static sbyte[] imageToBase64(ImageIcon paramImageIcon, int paramInt) { try { string str = "jpg"; if (paramInt == 1) { str = "png"; } else if (paramInt == 3) { str = "gif"; } BufferedImage bufferedImage = (BufferedImage)paramImageIcon.Image; MemoryStream byteArrayOutputStream = new MemoryStream(); ImageIO.write(bufferedImage, str, byteArrayOutputStream); sbyte[] arrayOfByte = byteArrayOutputStream.toByteArray(); return(Base64.encode(arrayOfByte)); } catch (IOException) { return(null); } }
protected override void InitIcon(ImageIcon icon) { icon.m_Valid = true; }
// Use this for initialization void Start() { imageIcon = GameObject.Find("Image Icon(Clone)").GetComponent<ImageIcon>(); }
public override Image getLogo() { Image logo = base.getLogo(); if (logo == null) { URL resource = Object.instancehelper_getClass((object) this).getClassLoader(JFreeChartInfo.__\u003CGetCallerID\u003E()).getResource("org/jfree/chart/gorilla.jpg"); if (resource != null) { logo = new ImageIcon(resource).getImage(); this.setLogo(logo); } } return logo; }
void BuildUI () { var b = View.Bounds; var statusHeight = 22.0f; // // Account Field // var fieldHeight = 33; accountField = new ChoiceField ( #if ! __UNIFIED__ new RectangleF (0, b.Y, b.Width, 33), #else new RectangleF (0, (float)b.Y, (float)b.Width, 33), #endif this, NSBundle.MainBundle.LocalizedString ("From", "From title when sharing")); View.AddSubview (accountField); b.Y += fieldHeight; b.Height -= fieldHeight; // // Text Editor // var editorHeight = b.Height; if (service.HasMaxTextLength || item.Links.Count > 0) { editorHeight -= statusHeight; } textEditor = new UITextView ( #if ! __UNIFIED__ new RectangleF (0, b.Y, b.Width, editorHeight)) #else new RectangleF (0, (float) b.Y, (float) b.Width, (float)editorHeight)) #endif { Font = TextEditorFont, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight, Text = item.Text, }; textEditor.Delegate = new TextEditorDelegate (this); View.AddSubview (textEditor); // // Icons // if (item.Images.Count > 0) { var rem = 4.0f; RectangleF f; var x = b.Right - AttachmentIcon.Size - 8 - rem*(item.Images.Count - 1); var y = textEditor.Frame.Y + 8; #if ! __UNIFIED__ f = textEditor.Frame; f.Width = x - 8 - f.X; #else f = (RectangleF)textEditor.Frame; f.Width = (float)x - 8 - f.X; #endif textEditor.Frame = f; foreach (var i in item.Images) { var icon = new ImageIcon (i.Image); #if ! __UNIFIED__ f = icon.Frame; f.X = x; f.Y = y; #else f = (RectangleF) icon.Frame; f.X = (float)x; f.Y = (float)y; #endif icon.Frame = f; View.AddSubview (icon); x += rem; y += rem; } } // // Remaining Text Length // if (service.HasMaxTextLength) { textLengthLabel = new TextLengthLabel ( #if ! __UNIFIED__ new RectangleF (4, b.Bottom - statusHeight, textEditor.Frame.Width - 8, statusHeight), #else new RectangleF (4, (float)(b.Bottom - statusHeight), (float)(textEditor.Frame.Width - 8), statusHeight), #endif service.MaxTextLength) { TextLength = service.GetTextLength (item), }; View.AddSubview (textLengthLabel); } // // Links Label // if (item.Links.Count > 0) { linksLabel = new UILabel ( #if ! __UNIFIED__ new RectangleF (4, b.Bottom - statusHeight, textEditor.Frame.Width - 66, statusHeight)) { #else new RectangleF (4, (float)(b.Bottom - statusHeight), (float)(textEditor.Frame.Width - 66), statusHeight)) { #endif TextColor = UIColor.FromRGB (124, 124, 124), AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleWidth, UserInteractionEnabled = false, BackgroundColor = UIColor.Clear, Font = UIFont.SystemFontOfSize (16), LineBreakMode = UILineBreakMode.HeadTruncation, }; if (item.Links.Count == 1) { linksLabel.Text = item.Links[0].AbsoluteUri; } else { linksLabel.Text = string.Format ( NSBundle.MainBundle.LocalizedString ("{0} links", "# of links label"), item.Links.Count); } View.AddSubview (linksLabel); } // // Navigation Items // NavigationItem.LeftBarButtonItem = new UIBarButtonItem ( UIBarButtonSystemItem.Cancel, delegate { completionHandler (ShareResult.Cancelled); }); NavigationItem.RightBarButtonItem = new UIBarButtonItem ( NSBundle.MainBundle.LocalizedString ("Send", "Send button text when sharing"), UIBarButtonItemStyle.Done, HandleSend); // // Watch for the keyboard // NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.DidShowNotification, HandleKeyboardDidShow); NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillHideNotification, HandleKeyboardDidHide); } void HandleSend (object sender, EventArgs e) { if (sharing) return; item.Text = textEditor.Text; StartSharing (); var account = accounts.FirstOrDefault (); if (accounts.Count > 1 && accountField != null) { account = accounts.FirstOrDefault (x => x.Username == accountField.SelectedItem); } try { service.ShareItemAsync (item, account).ContinueWith (shareTask => { StopSharing (); if (shareTask.IsFaulted) { this.ShowError ("Share Error", shareTask.Exception); } else { completionHandler (ShareResult.Done); } }, TaskScheduler.FromCurrentSynchronizationContext ()); } catch (Exception ex) { StopSharing (); this.ShowError ("Share Error", ex); } } void StartSharing () { sharing = true; NavigationItem.RightBarButtonItem.Enabled = false; if (progress == null) { progress = new ProgressLabel (NSBundle.MainBundle.LocalizedString ("Sending...", "Sending... status message when sharing")); NavigationItem.TitleView = progress; progress.StartAnimating (); } } void StopSharing () { sharing = false; NavigationItem.RightBarButtonItem.Enabled = true; if (progress != null) { progress.StopAnimating (); NavigationItem.TitleView = null; progress = null; } }
void BuildUI () { var b = View.Bounds; var statusHeight = 22.0f; // // Account Field // var fieldHeight = 33; accountField = new ChoiceField ( new RectangleF (0, b.Y, b.Width, 33), this, NSBundle.MainBundle.LocalizedString ("From", "From title when sharing")); View.AddSubview (accountField); b.Y += fieldHeight; b.Height -= fieldHeight; // // Text Editor // var editorHeight = b.Height; if (service.HasMaxTextLength || item.Links.Count > 0) { editorHeight -= statusHeight; } textEditor = new UITextView (new RectangleF (0, b.Y, b.Width, editorHeight)) { Font = TextEditorFont, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight, Text = item.Text, }; textEditor.Delegate = new TextEditorDelegate (this); View.AddSubview (textEditor); // // Icons // if (item.Images.Count > 0) { var rem = 4.0f; RectangleF f; var x = b.Right - AttachmentIcon.Size - 8 - rem*(item.Images.Count - 1); var y = textEditor.Frame.Y + 8; f = textEditor.Frame; f.Width = x - 8 - f.X; textEditor.Frame = f; foreach (var i in item.Images) { var icon = new ImageIcon (i.Image); f = icon.Frame; f.X = x; f.Y = y; icon.Frame = f; View.AddSubview (icon); x += rem; y += rem; } } // // Remaining Text Length // if (service.HasMaxTextLength) { textLengthLabel = new TextLengthLabel ( new RectangleF (4, b.Bottom - statusHeight, textEditor.Frame.Width - 8, statusHeight), service.MaxTextLength) { TextLength = service.GetTextLength (item), }; View.AddSubview (textLengthLabel); } // // Links Label // if (item.Links.Count > 0) { linksLabel = new UILabel ( new RectangleF (4, b.Bottom - statusHeight, textEditor.Frame.Width - 66, statusHeight)) { TextColor = UIColor.FromRGB (124, 124, 124), AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleWidth, UserInteractionEnabled = false, BackgroundColor = UIColor.Clear, Font = UIFont.SystemFontOfSize (16), LineBreakMode = UILineBreakMode.HeadTruncation, }; if (item.Links.Count == 1) { linksLabel.Text = item.Links[0].AbsoluteUri; } else { linksLabel.Text = string.Format ( NSBundle.MainBundle.LocalizedString ("{0} links", "# of links label"), item.Links.Count); } View.AddSubview (linksLabel); } // // Navigation Items // NavigationItem.LeftBarButtonItem = new UIBarButtonItem ( UIBarButtonSystemItem.Cancel, delegate { completionHandler (ShareResult.Cancelled); }); NavigationItem.RightBarButtonItem = new UIBarButtonItem ( NSBundle.MainBundle.LocalizedString ("Send", "Send button text when sharing"), UIBarButtonItemStyle.Done, HandleSend); // // Watch for the keyboard // NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.DidShowNotification, HandleKeyboardDidShow); NSNotificationCenter.DefaultCenter.AddObserver (UIKeyboard.WillHideNotification, HandleKeyboardDidHide); }