预览
代码
手机端效果
web端效果
demoZoomImage.cs
demoZoomImage.Designer.cs
web:demoZoomImage.cs
web:demoZoomImage.Designer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace Smobiler.Tutorials.Components
{
partial class demoZoomImage : Smobiler.Core.Controls.MobileForm
{
public demoZoomImage()
: 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.Components
{
partial class demoZoomImage : 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.panel10 = new Smobiler.Core.Controls.Panel();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.zoomImage1 = new Smobiler.Core.Controls.ZoomImage();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.label5 = new Smobiler.Core.Controls.Label();
this.zoomImage2 = new Smobiler.Core.Controls.ZoomImage();
this.panel3 = new Smobiler.Core.Controls.Panel();
this.label1 = new Smobiler.Core.Controls.Label();
this.label2 = new Smobiler.Core.Controls.Label();
//
// 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 = "ZoomImage";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.panel2,
this.panel3});
this.panel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel10.Location = new System.Drawing.Point(0, 30);
this.panel10.Name = "panel10";
this.panel10.Scrollable = true;
this.panel10.Size = new System.Drawing.Size(300, 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.labTitle,
this.zoomImage1});
this.panel1.Location = new System.Drawing.Point(5, 9);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(290, 249);
//
// 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, 54);
this.labContent.Text = "ResourceID、ResourceMode、ResourcecPath属性设置图片资源名称、模式、路径";
//
// 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 = "可直接缩放图像控件";
//
// zoomImage1
//
this.zoomImage1.Location = new System.Drawing.Point(9, 89);
this.zoomImage1.Name = "zoomImage1";
this.zoomImage1.ResourceID = "logon";
this.zoomImage1.Size = new System.Drawing.Size(275, 150);
//
// 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.label5,
this.zoomImage2});
this.panel2.Location = new System.Drawing.Point(5, 273);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(290, 223);
//
// label5
//
this.label5.BackColor = System.Drawing.Color.WhiteSmoke;
this.label5.FontSize = 15F;
this.label5.Name = "label5";
this.label5.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label5.Size = new System.Drawing.Size(290, 54);
this.label5.Text = "MaxZoomScale、MinZoomScale、ZoomScale属性设置图片缩放比例";
//
// zoomImage2
//
this.zoomImage2.Location = new System.Drawing.Point(9, 65);
this.zoomImage2.MaxZoomScale = 5F;
this.zoomImage2.MinZoomScale = 0.8F;
this.zoomImage2.Name = "zoomImage2";
this.zoomImage2.ResourceID = "logon";
this.zoomImage2.Size = new System.Drawing.Size(275, 150);
this.zoomImage2.ZoomScale = 2F;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.White;
this.panel3.Border = new Smobiler.Core.Controls.Border(1F);
this.panel3.BorderColor = System.Drawing.Color.Silver;
this.panel3.BorderRadius = 5;
this.panel3.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.label1,
this.label2});
this.panel3.Location = new System.Drawing.Point(5, 503);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(290, 87);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.WhiteSmoke;
this.label1.FontSize = 15F;
this.label1.Location = new System.Drawing.Point(0, 26);
this.label1.Name = "label1";
this.label1.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label1.Size = new System.Drawing.Size(290, 54);
this.label1.Text = "Refresh重新加载资源(当资源图片修改,而ResouceID不变的情况下,需要调用重新加载来刷新图片)";
//
// label2
//
this.label2.BackColor = System.Drawing.Color.WhiteSmoke;
this.label2.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.label2.BorderColor = System.Drawing.Color.DarkSeaGreen;
this.label2.FontSize = 16F;
this.label2.Name = "label2";
this.label2.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label2.Size = new System.Drawing.Size(290, 26);
this.label2.Text = "重新加载方法";
//
// demoZoomImage
//
this.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.title1,
this.panel10});
this.Size = new System.Drawing.Size(300, 1000);
this.Name = "demoZoomImage";
}
#endregion
private Core.Controls.Title title1;
private Core.Controls.Panel panel10;
private Core.Controls.Panel panel1;
private Core.Controls.Label labContent;
private Core.Controls.Label labTitle;
private Core.Controls.Panel panel2;
private Core.Controls.Label label5;
private Core.Controls.ZoomImage zoomImage1;
private Core.Controls.ZoomImage zoomImage2;
private Core.Controls.Panel panel3;
private Core.Controls.Label label1;
private Core.Controls.Label label2;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smobiler.Core;
using Smobiler.Core.Controls;
namespace SmobilerTutorialsWeb.Components
{
partial class demoZoomImage : Smobiler.Core.Controls.MobileForm
{
public demoZoomImage() : 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 demoZoomImage : 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.panel10 = new Smobiler.Core.Controls.Panel();
this.panel1 = new Smobiler.Core.Controls.Panel();
this.labContent = new Smobiler.Core.Controls.Label();
this.zoomImage1 = new Smobiler.Core.Controls.ZoomImage();
this.panel2 = new Smobiler.Core.Controls.Panel();
this.label5 = new Smobiler.Core.Controls.Label();
this.zoomImage2 = new Smobiler.Core.Controls.ZoomImage();
this.panel3 = new Smobiler.Core.Controls.Panel();
this.label1 = new Smobiler.Core.Controls.Label();
this.labTitle = new Smobiler.Core.Controls.Label();
this.label2 = new Smobiler.Core.Controls.Label();
//
// 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 = "ZoomImage";
this.title1.ImagePress += new System.EventHandler(this.title1_ImagePress);
//
// panel10
//
this.panel10.BackColor = System.Drawing.Color.White;
this.panel10.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.panel1,
this.panel2,
this.panel3,
this.labTitle,
this.label2});
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.zoomImage1});
this.panel1.Location = new System.Drawing.Point(130, 57);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(427, 249);
//
// labContent
//
this.labContent.BackColor = System.Drawing.Color.White;
this.labContent.Location = new System.Drawing.Point(0, 194);
this.labContent.Name = "labContent";
this.labContent.Padding = new Smobiler.Core.Controls.Padding(5F);
this.labContent.Size = new System.Drawing.Size(427, 54);
this.labContent.Text = "ResourceID、ResourceMode、ResourcecPath属性设置图片资源名称、模式、路径";
//
// zoomImage1
//
this.zoomImage1.Location = new System.Drawing.Point(80, 18);
this.zoomImage1.Name = "zoomImage1";
this.zoomImage1.ResourceID = "logon";
this.zoomImage1.Size = new System.Drawing.Size(275, 150);
//
// 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.label5,
this.zoomImage2});
this.panel2.Location = new System.Drawing.Point(652, 57);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(427, 247);
//
// label5
//
this.label5.BackColor = System.Drawing.Color.White;
this.label5.Location = new System.Drawing.Point(0, 193);
this.label5.Name = "label5";
this.label5.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label5.Size = new System.Drawing.Size(427, 54);
this.label5.Text = "MaxZoomScale、MinZoomScale、ZoomScale属性设置图片缩放比例";
//
// zoomImage2
//
this.zoomImage2.Location = new System.Drawing.Point(38, 21);
this.zoomImage2.MaxZoomScale = 5F;
this.zoomImage2.MinZoomScale = 0.8F;
this.zoomImage2.Name = "zoomImage2";
this.zoomImage2.ResourceID = "logon";
this.zoomImage2.Size = new System.Drawing.Size(347, 150);
this.zoomImage2.ZoomScale = 2F;
//
// panel3
//
this.panel3.BackColor = System.Drawing.Color.White;
this.panel3.Border = new Smobiler.Core.Controls.Border(1F);
this.panel3.BorderColor = System.Drawing.Color.Silver;
this.panel3.BorderRadius = 5;
this.panel3.Controls.AddRange(new Smobiler.Core.Controls.MobileControl[] {
this.label1});
this.panel3.Location = new System.Drawing.Point(130, 363);
this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(427, 125);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(0, 28);
this.label1.Name = "label1";
this.label1.Padding = new Smobiler.Core.Controls.Padding(5F);
this.label1.Size = new System.Drawing.Size(426, 54);
this.label1.Text = "Refresh重新加载资源(当资源图片修改,而ResouceID不变的情况下,需要调用重新加载来刷新图片)";
//
// 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(130, 30);
this.labTitle.Name = "labTitle";
this.labTitle.Size = new System.Drawing.Size(427, 26);
this.labTitle.Text = "可直接缩放图像控件";
//
// label2
//
this.label2.BackColor = System.Drawing.Color.White;
this.label2.Bold = true;
this.label2.Border = new Smobiler.Core.Controls.Border(0F, 0F, 0F, 1F);
this.label2.BorderColor = System.Drawing.Color.White;
this.label2.FontSize = 16F;
this.label2.Location = new System.Drawing.Point(130, 336);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(427, 26);
this.label2.Text = "重新加载方法";
//
// demoZoomImage
//
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 = "demoZoomImage";
}
#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.ZoomImage zoomImage1;
private Smobiler.Core.Controls.Panel panel2;
private Smobiler.Core.Controls.Label label5;
private Smobiler.Core.Controls.ZoomImage zoomImage2;
private Smobiler.Core.Controls.Panel panel3;
private Smobiler.Core.Controls.Label label1;
private Smobiler.Core.Controls.Label labTitle;
private Smobiler.Core.Controls.Label label2;
}
}