有几个问题需要大家帮忙,谢谢支持
1 需要在画板上画矩形,但是首先要画一幅很大的图片:就是鼠标每次移动要出现矩形的图像,鼠标松开画好,但是同时也画了图片,由于鼠标移动中要不断重画大的图片和矩形,所以速度很慢。注意:已经使用了双缓存技术 但是仍然很慢 请问有没有好主意2 在一个类中定义一个private 的arraylist1 然后用它保存一个临时的数据。再写一个arraylist2=arraylist1 然后每次修改arraylist2 但是发现arraylist1 也跟着发生变化 请问是什么问题3 folderBrowserDialog 类型的一个对象 在调用方法 showDialog() 后, 弹出选择文件夹的提示框
但是现在出现该dialog显示不全的问题 就是中间部分都是灰的 只有 ok 和 cancle 这两个 按钮 请问是什么问题 谢谢 啊
着急啊 请高手帮忙
1 需要在画板上画矩形,但是首先要画一幅很大的图片:就是鼠标每次移动要出现矩形的图像,鼠标松开画好,但是同时也画了图片,由于鼠标移动中要不断重画大的图片和矩形,所以速度很慢。注意:已经使用了双缓存技术 但是仍然很慢 请问有没有好主意2 在一个类中定义一个private 的arraylist1 然后用它保存一个临时的数据。再写一个arraylist2=arraylist1 然后每次修改arraylist2 但是发现arraylist1 也跟着发生变化 请问是什么问题3 folderBrowserDialog 类型的一个对象 在调用方法 showDialog() 后, 弹出选择文件夹的提示框
但是现在出现该dialog显示不全的问题 就是中间部分都是灰的 只有 ok 和 cancle 这两个 按钮 请问是什么问题 谢谢 啊
着急啊 请高手帮忙
解决这个问题的办法,是做ActiveX,让客户下载后,在本地画,之后点击确定,再发送到服务器!!如果这个问题是出现在winApp中,你要注意的是这个图片到底有多大??如果太大的话,是否每次Point都会重新再次画出这个图而不是刷新这个图???2.因为你只new出来一个ArrayList,另外一个ArrayList2是指向ArrayList1的..他们共享一个内存对象,就是你new出来的这个ArrayList的内存...例如,两个人用一个碗吃饭一样..随便谁吃一口,碗里都会少饭...3.这个folderBrowserDialog 类型.用下面的代码试一下
用微软的测试代码看一下..拷贝下面的代码到winApp中..
========================================================using System;
using System.Drawing;
using System.Windows.Forms;
using System.IO;public class FolderBrowserDialogExampleForm : System.Windows.Forms.Form
{
private FolderBrowserDialog folderBrowserDialog1;
private OpenFileDialog openFileDialog1;
private RichTextBox richTextBox1; private MainMenu mainMenu1;
private MenuItem fileMenuItem, openMenuItem;
private MenuItem folderMenuItem, closeMenuItem;
private string openFileName, folderName; private bool fileOpened = false; // The main entry point for the application.
static void Main()
{
Application.Run(new FolderBrowserDialogExampleForm());
}
// Constructor.
public FolderBrowserDialogExampleForm()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.fileMenuItem = new System.Windows.Forms.MenuItem();
this.openMenuItem = new System.Windows.Forms.MenuItem();
this.folderMenuItem = new System.Windows.Forms.MenuItem();
this.closeMenuItem = new System.Windows.Forms.MenuItem(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.mainMenu1.MenuItems.Add(this.fileMenuItem);
this.fileMenuItem.MenuItems.AddRange(
new System.Windows.Forms.MenuItem[] {this.openMenuItem,
this.closeMenuItem,
this.folderMenuItem});
this.fileMenuItem.Text = "File"; this.openMenuItem.Text = "Open...";
this.openMenuItem.Click += new System.EventHandler(this.openMenuItem_Click); this.folderMenuItem.Text = "Select Directory...";
this.folderMenuItem.Click += new System.EventHandler(this.folderMenuItem_Click); this.closeMenuItem.Text = "Close";
this.closeMenuItem.Click += new System.EventHandler(this.closeMenuItem_Click);
this.closeMenuItem.Enabled = false; this.openFileDialog1.DefaultExt = "rtf";
this.openFileDialog1.Filter = "rtf files (*.rtf)|*.rtf"; // Set the help text description for the FolderBrowserDialog.
this.folderBrowserDialog1.Description =
"Select the directory that you want to use as the default."; // Do not allow the user to create new files via the FolderBrowserDialog.
this.folderBrowserDialog1.ShowNewFolderButton = false; // Default to the My Documents folder.
this.folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Personal; this.richTextBox1.AcceptsTab = true;
this.richTextBox1.Location = new System.Drawing.Point(8, 8);
this.richTextBox1.Size = new System.Drawing.Size(280, 344);
this.richTextBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left |
AnchorStyles.Bottom | AnchorStyles.Right; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(296, 360);
this.Controls.Add(this.richTextBox1);
this.Menu = this.mainMenu1;
this.Text = "RTF Document Browser";
} // Bring up a dialog to open a file.
private void openMenuItem_Click(object sender, System.EventArgs e)
{
// If a file is not opened, then set the initial directory to the
// FolderBrowserDialog.SelectedPath value.
if (!fileOpened)
{
openFileDialog1.InitialDirectory = folderBrowserDialog1.SelectedPath;
openFileDialog1.FileName = null;
} // Display the openFile dialog.
DialogResult result = openFileDialog1.ShowDialog(); // OK button was pressed.
if(result == DialogResult.OK)
{
openFileName = openFileDialog1.FileName;
try
{
// Output the requested file in richTextBox1.
Stream s = openFileDialog1.OpenFile();
richTextBox1.LoadFile(s, RichTextBoxStreamType.RichText);
s.Close();
fileOpened = true; }
catch(Exception exp)
{
MessageBox.Show("An error occurred while attempting to load the file. The error is:"
+ System.Environment.NewLine + exp.ToString() + System.Environment.NewLine);
fileOpened = false;
}
Invalidate(); closeMenuItem.Enabled = fileOpened;
} // Cancel button was pressed.
else if(result == DialogResult.Cancel)
{
return;
}
}
// Close the current file.
private void closeMenuItem_Click(object sender, System.EventArgs e)
{
richTextBox1.Text = "";
fileOpened = false; closeMenuItem.Enabled = false;
}
// Bring up a dialog to chose a folder path in which to open or save a file.
private void folderMenuItem_Click(object sender, System.EventArgs e)
{
// Show the FolderBrowserDialog.
DialogResult result = folderBrowserDialog1.ShowDialog();
if( result == DialogResult.OK )
{
folderName = folderBrowserDialog1.SelectedPath;
if(!fileOpened)
{
// No file is opened, bring up openFileDialog in selected path.
openFileDialog1.InitialDirectory = folderName;
openFileDialog1.FileName = null;
openMenuItem.PerformClick();
}
}
} private void InitializeComponent()
{
//
// FolderBrowserDialogExampleForm
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "FolderBrowserDialogExampleForm";
this.Load += new System.EventHandler(this.FolderBrowserDialogExampleForm_Load); } private void FolderBrowserDialogExampleForm_Load(object sender, System.EventArgs e)
{
}
}
ArrayList list2 = new ArrayList( list1 );不过记住,这是浅表复制,只是把容器复制了一份,而里面的元素并不会产生拷贝。直接修改元素的话,还是会出问题……
1, 并不是缓存的问题, 注意你每次刷新的范围,只对有必要刷新的地方刷新,这样才能做到闪烁很小
2, 两个指针指的是一个区域,你需要赋值的时候用copy
谢谢了阿
bingbingcha(不思不归,不孟不E,原来是头大灰狼) 看到了请能再指导指导我啊
对阿
那里人很少阿
没有人告诉我呀
我得把很大的图当成背景来在上面画啊
而且不能做为背景图 因为还要放大 缩小 或者调那个背景的位置