预览
代码
手机端效果
web端效果
demoImageEx.cs
demoImageEx.Designer.cs
web:demoImageEx.cs
web:demoImageEx.Designer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace Smobiler.Tutorials.Controls
{
partial class demoImageEx : Smobiler.Core.Controls.MobileForm
{
public demoImageEx() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
}
}
using System;
using Smobiler.Core;
namespace Smobiler.Tutorials.Controls
{
partial class demoImageEx : Smobiler.Core.Controls.MobileForm
{
#region "SmobilerForm generated code "
//SmobilerForm overrides dispose to clean up the component list.
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
//NOTE: The following procedure is required by the SmobilerForm
//It can be modified using the SmobilerForm.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
this.title1 = new Smobiler.Core.Controls.Title();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.imageEx1 = new Smobiler.Core.Controls.ImageEx();
this.imageEx2 = new Smobiler.Core.Controls.ImageEx();
//
// title1
//
this.title1.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.title1.Name = "title1";
this.title1.ResourceID = "angle-left";
this.title1.Size = new System.Drawing.Size(300, 30);
this.title1.Text = "ImageEx";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel1
//
this.panel1.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel2});
this.panel1.Flex = 1;
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(0, 100);
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Border = new Smobiler.Core.Controls.Border(1F);
this.panel2.BorderColor = System.Drawing.Color.Silver;
this.panel2.BorderRadius = 5;
this.panel2.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.labContent,
this.labTitle,
this.imageEx1,
this.imageEx2});
this.panel2.Location = new System.Drawing.Point(5, 9);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(290, 213);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.WhiteSmoke;
this.labContent.FontSize = 15F;
this.labContent.Location = new System.Drawing.Point(0, 26);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(290, 90);
this.labContent.Text = "图片显示控件(集合了Image控件和FontIcon的功能)\r\nImageType图像类型\r\nResourceID图像资源名称\r\nResourcePath图像存储" +
"路径";
this.labContent.VerticalAlignment = Smobiler.Core.Controls.VerticalAlignment.Top;
//
// labTitle
//
this.labTitle.BackColor = System.Drawing.Color.WhiteSmoke;
this.labTitle.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.labTitle.BorderColor = System.Drawing.Color.DarkSeaGreen;
this.labTitle.FontSize = 16F;
this.labTitle.Name = "labTitle";
this.labTitle.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labTitle.Size = new System.Drawing.Size(290, 26);
this.labTitle.Text = "不同样式的ImageEx";
//
// imageEx1
//
this.imageEx1.Location = new System.Drawing.Point(35, 131);
this.imageEx1.Name = "imageEx1";
this.imageEx1.ResourceID = "logon";
this.imageEx1.Size = new System.Drawing.Size(70, 70);
//
// imageEx2
//
this.imageEx2.IconColor = System.Drawing.Color.Green;
this.imageEx2.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.imageEx2.Location = new System.Drawing.Point(146, 131);
this.imageEx2.Name = "imageEx2";
this.imageEx2.ResourceID = "weixin";
this.imageEx2.Size = new System.Drawing.Size(67, 70);
//
// demoImageEx
//
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel1});
this.Layout = Smobiler.Core.Controls.LayoutPosition.Relative;
this.Name = "demoImageEx";
}
#endregion
private Core.Controls.Title title1;
private Core.Controls.Panel panel1;
private Core.Controls.Panel panel2;
private Core.Controls.Label labContent;
private Core.Controls.Label labTitle;
private Core.Controls.ImageEx imageEx1;
private Core.Controls.ImageEx imageEx2;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.Components
{
partial class demoImageEX : Smobiler.Core.Controls.MobileForm
{
public demoImageEX() : base()
{
//This call is required by the SmobilerForm.
InitializeComponent();
}
private void title1_ImagePress(object sender, EventArgs e)
{
this.Close();
}
}
}
using System;
using Smobiler.Core;
namespace SmobilerTutorialsWeb.Components
{
partial class demoImageEX : Smobiler.Core.Controls.MobileForm
{
#region "SmobilerForm generated code "
//SmobilerForm overrides dispose to clean up the component list.
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
//NOTE: The following procedure is required by the SmobilerForm
//It can be modified using the SmobilerForm.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(demoImageEX));
this.title1 = new Smobiler.Core.Controls.Title();
this.panel10 = new Smobiler.Core.Controls.Panel();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.label13 = new Smobiler.Core.Controls.Label();
this.label5 = new Smobiler.Core.Controls.Label();
this.label7 = new Smobiler.Core.Controls.Label();
this.label8 = new Smobiler.Core.Controls.Label();
this.label9 = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.label6 = new Smobiler.Core.Controls.Label();
this.imageEx1 = new Smobiler.Core.Controls.ImageEx();
this.imageEx2 = new Smobiler.Core.Controls.ImageEx();
this.imageEx7 = new Smobiler.Core.Controls.ImageEx();
this.imageEx6 = new Smobiler.Core.Controls.ImageEx();
this.imageEx5 = new Smobiler.Core.Controls.ImageEx();
this.imageEx3 = new Smobiler.Core.Controls.ImageEx();
this.imageEx4 = new Smobiler.Core.Controls.ImageEx();
//
// title1
//
this.title1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(246)))), ((int)(((byte)(246)))), ((int)(((byte)(246)))));
this.title1.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.title1.Name = "title1";
this.title1.ResourceID = "angle-left";
this.title1.Size = new System.Drawing.Size(0, 30);
this.title1.Text = "ImageEX";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.panel2,
this.labTitle,
this.label6});
this.panel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel10.Flex = 1;
this.panel10.Name = "panel10";
this.panel10.Scrollable = true;
this.panel10.Size = new System.Drawing.Size(0, 970);
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.White;
this.panel1.Border = new Smobiler.Core.Controls.Border(1F);
this.panel1.BorderColor = System.Drawing.Color.Silver;
this.panel1.BorderRadius = 5;
this.panel1.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.labContent,
this.imageEx1,
this.imageEx2});
this.panel1.Location = new System.Drawing.Point(123, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(427, 243);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.White;
this.labContent.BorderColor = System.Drawing.Color.White;
this.labContent.Location = new System.Drawing.Point(0, 166);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(427, 76);
this.labContent.Text = resources.GetString("labContent.Text");
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Border = new Smobiler.Core.Controls.Border(1F);
this.panel2.BorderColor = System.Drawing.Color.Silver;
this.panel2.BorderRadius = 5;
this.panel2.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.label13,
this.label5,
this.label7,
this.label8,
this.label9,
this.imageEx7,
this.imageEx6,
this.imageEx5,
this.imageEx3,
this.imageEx4});
this.panel2.Location = new System.Drawing.Point(650, 57);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(427, 243);
//
// label13
//
this.label13.BackColor = System.Drawing.Color.White;
this.label13.BorderColor = System.Drawing.Color.White;
this.label13.Location = new System.Drawing.Point(0, 110);
this.label13.Name = "label13";
this.label13.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label13.Size = new System.Drawing.Size(427, 133);
this.label13.Text = "sizeMode属性设置图片的显示模式\r\nDefault:图像不会放大;如果大于视图面积,那么会缩小图像,使其完全可见\r\nCover:在保持图片宽高比的前提下缩放" +
"图片,直到宽度和高度都大于等于容器视图的尺寸\r\nZoom:在保持图片宽高比的前提下缩放图片,直到宽度和高度都小于等于容器视图的尺寸\r\nStretch:拉伸图片且" +
"不维持宽高比,直到宽高都刚好填满容器";
//
// label5
//
this.label5.Location = new System.Drawing.Point(47, 81);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(50, 29);
this.label5.Text = "Default";
//
// label7
//
this.label7.Location = new System.Drawing.Point(141, 81);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(50, 29);
this.label7.Text = "Cover";
//
// label8
//
this.label8.Location = new System.Drawing.Point(235, 81);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(50, 29);
this.label8.Text = "Zoom";
//
// label9
//
this.label9.Location = new System.Drawing.Point(329, 81);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(50, 29);
this.label9.Text = "Strentch";
//
// labTitle
//
this.labTitle.BackColor = System.Drawing.Color.White;
this.labTitle.Bold = true;
this.labTitle.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.labTitle.BorderColor = System.Drawing.Color.White;
this.labTitle.FontSize = 16F;
this.labTitle.Location = new System.Drawing.Point(123, 30);
this.labTitle.Name = "labTitle";
this.labTitle.Size = new System.Drawing.Size(427, 26);
this.labTitle.Text = "图像控件";
//
// label6
//
this.label6.BackColor = System.Drawing.Color.White;
this.label6.Bold = true;
this.label6.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.label6.BorderColor = System.Drawing.Color.White;
this.label6.FontSize = 16F;
this.label6.Location = new System.Drawing.Point(650, 30);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(427, 26);
this.label6.Text = "不同SizeMode 的图片";
//
// imageEx1
//
this.imageEx1.Location = new System.Drawing.Point(66, 39);
this.imageEx1.Name = "imageEx1";
this.imageEx1.ResourceID = "logon";
this.imageEx1.Size = new System.Drawing.Size(97, 75);
//
// imageEx2
//
this.imageEx2.IconColor = System.Drawing.Color.Green;
this.imageEx2.ImageType = Smobiler.Core.Controls.ImageEx.ImageStyle.FontIcon;
this.imageEx2.Location = new System.Drawing.Point(251, 39);
this.imageEx2.Name = "imageEx2";
this.imageEx2.ResourceID = "weixin";
this.imageEx2.Size = new System.Drawing.Size(97, 75);
//
// imageEx7
//
this.imageEx7.BackColor = System.Drawing.Color.WhiteSmoke;
this.imageEx7.Location = new System.Drawing.Point(329, 16);
this.imageEx7.Name = "imageEx7";
this.imageEx7.ResourceID = "logon";
this.imageEx7.Size = new System.Drawing.Size(50, 65);
this.imageEx7.SizeMode = Smobiler.Core.Controls.ImageSizeMode.Stretch;
//
// imageEx6
//
this.imageEx6.BackColor = System.Drawing.Color.WhiteSmoke;
this.imageEx6.Location = new System.Drawing.Point(235, 16);
this.imageEx6.Name = "imageEx6";
this.imageEx6.ResourceID = "logon";
this.imageEx6.Size = new System.Drawing.Size(50, 65);
this.imageEx6.SizeMode = Smobiler.Core.Controls.ImageSizeMode.Zoom;
//
// imageEx5
//
this.imageEx5.BackColor = System.Drawing.Color.WhiteSmoke;
this.imageEx5.Location = new System.Drawing.Point(141, 16);
this.imageEx5.Name = "imageEx5";
this.imageEx5.ResourceID = "logon";
this.imageEx5.Size = new System.Drawing.Size(50, 65);
this.imageEx5.SizeMode = Smobiler.Core.Controls.ImageSizeMode.Cover;
//
// imageEx3
//
this.imageEx3.BackColor = System.Drawing.Color.WhiteSmoke;
this.imageEx3.Location = new System.Drawing.Point(47, 16);
this.imageEx3.Name = "imageEx3";
this.imageEx3.ResourceID = "logon";
this.imageEx3.Size = new System.Drawing.Size(50, 65);
//
// imageEx4
//
this.imageEx4.BackColor = System.Drawing.Color.WhiteSmoke;
this.imageEx4.Location = new System.Drawing.Point(47, 16);
this.imageEx4.Name = "imageEx4";
this.imageEx4.ResourceID = "logon";
this.imageEx4.Size = new System.Drawing.Size(50, 65);
//
// demoImageEX
//
this.BackColor = System.Drawing.Color.White;
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Layout = Smobiler.Core.Controls.LayoutPosition.Relative;
this.Size = new System.Drawing.Size(1200, 800);
this.Name = "demoImageEX";
}
#endregion
private Smobiler.Core.Controls.Title title1;
private Smobiler.Core.Controls.Panel panel10;
private Smobiler.Core.Controls.Panel panel1;
private Smobiler.Core.Controls.Label labContent;
private Smobiler.Core.Controls.ImageEx imageEx1;
private Smobiler.Core.Controls.Panel panel2;
private Smobiler.Core.Controls.Label label13;
private Smobiler.Core.Controls.Label label5;
private Smobiler.Core.Controls.Label label7;
private Smobiler.Core.Controls.Label label8;
private Smobiler.Core.Controls.Label label9;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.Label label6;
private Smobiler.Core.Controls.ImageEx imageEx2;
private Smobiler.Core.Controls.ImageEx imageEx7;
private Smobiler.Core.Controls.ImageEx imageEx6;
private Smobiler.Core.Controls.ImageEx imageEx5;
private Smobiler.Core.Controls.ImageEx imageEx3;
private Smobiler.Core.Controls.ImageEx imageEx4;
}
}