how do working GDI+ . i don't know.. you see. mothod.. . please..!!
sonic747
Posts
-
how about erasing trace of Rectangle? [modified] -
how about erasing trace of Rectangle? [modified]if exist background image, don't this mothod this mothod is fill the white color... are you other mothod ??....
-
how about erasing trace of Rectangle? [modified]hello.. this program is based of C# and WPF i draw Rectangle as mouse but this program get stain of Rectangle i want to disply without leaving any trace of Rectangle.. help me.. im sorry short english.. Screen Capture Image DownLoad ////////////////source///
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Drawing;namespace rectTest
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}System.Drawing.Rectangle myRec; System.Windows.Point firstPoint; bool flg = false; private void Window\_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { flg = true; firstPoint = e.GetPosition(mainwin); myRec = new System.Drawing.Rectangle((int)firstPoint.X, (int)firstPoint.Y, 0, 0); } private void mainwin\_MouseMove(object sender, MouseEventArgs e) { if (flg == true) { System.Windows.Point currentPoint; currentPoint = e.GetPosition(mainwin); double width = currentPoint.X - firstPoint.X; double height = currentPoint.Y - firstPoint.Y; if (width > 0 && height > 0) { Graphics g = Graphics.FromHwnd(new System.Windows.Interop.WindowInteropHelper(this).Handle); System.Drawing.Pen myPen = new System.Drawing.Pen(System.Drawing.Color.Red, 5); g.DrawRectangle(myPen, myRec); myRec.Width = (int)width; myRec.Height = (int)height; InvalidateVisual(); } } } private void mainwin\_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { flg = false; } }
}
modified on Tuesday, June 1, 2010 3:37 AM
-
please help me!, delete error of the image files(attached source code)i want delete image file. very well insert image file to listbox. but, do not delete image file , please, take me a error,, attached the source project files, reply send to me(sonic747@esolgorup.co.kr) ---env c#, wpf, .net3.5 /.... source file download //imagefile insert to listbox/// private void button1_Click(object sender, RoutedEventArgs e) { savepath = System.Environment.CurrentDirectory.ToString(); foreach (string f in Directory.GetFiles(savepath + "/image", "*.jpg")) { BitmapImage my; my= new BitmapImage(); my.BeginInit(); my.CacheOption = BitmapCacheOption.OnLoad; my.UriSource = new Uri(f, UriKind.RelativeOrAbsolute); my.EndInit(); listBox1.Items.Add(my); } } /////////delete image file (error) /// private void button2_Click(object sender, RoutedEventArgs e) { string makestr1, item1; item1 = listBox1.Items[0].ToString(); makestr1 = item1.Substring(8, item1.Length - 8); listBox1.Items.Remove(listBox1.Items[0]); if (System.IO.File.Exists(makestr1)) { System.IO.File.Delete(makestr1); //<--error point } else MessageBox.Show("Nothingfile"); }
-
Plz, des'nt File Delete ,, [modified]//image insert to listbox/// private void button1_Click(object sender, RoutedEventArgs e) { savepath = System.Environment.CurrentDirectory.ToString(); foreach (string f in Directory.GetFiles(savepath + "/image", "*.jpg")) { BitmapImage my; my= new BitmapImage(); my.BeginInit(); my.CacheOption = BitmapCacheOption.OnLoad; my.UriSource = new Uri(f, UriKind.RelativeOrAbsolute); my.EndInit(); listBox1.Items.Add(my); } } /////////delete image file /// private void button2_Click(object sender, RoutedEventArgs e) { string makestr1, item1; item1 = listBox1.Items[0].ToString(); makestr1 = item1.Substring(8, item1.Length - 8); listBox1.Items.Remove(listBox1.Items[0]); if (System.IO.File.Exists(makestr1)) { System.IO.File.Delete(makestr1); //<--error point } else MessageBox.Show("Nothingfile"); } //error message.. do not access ! becouse using of other process
-
Plz, des'nt File Delete ,, [modified]i want delete image file. very well insert image file to listbox. but, does'nt delete image file , plz, take me a error,, --- c#, wpf, .net3.5 /.... source code attched project files, source file download //////////error code//// //image insert to listbox/// private void button1_Click(object sender, RoutedEventArgs e) { savepath = System.Environment.CurrentDirectory.ToString(); foreach (string f in Directory.GetFiles(savepath + "/image", "*.jpg")) { BitmapImage my; my= new BitmapImage(); my.BeginInit(); my.CacheOption = BitmapCacheOption.OnLoad; my.UriSource = new Uri(f, UriKind.RelativeOrAbsolute); my.EndInit(); listBox1.Items.Add(my); } } /////////delete image file /// private void button2_Click(object sender, RoutedEventArgs e) { string makestr1, item1; item1 = listBox1.Items[0].ToString(); makestr1 = item1.Substring(8, item1.Length - 8); listBox1.Items.Remove(listBox1.Items[0]); if (System.IO.File.Exists(makestr1)) { System.IO.File.Delete(makestr1); //<--error point } else MessageBox.Show("Nothingfile"); } //error message..
modified on Tuesday, May 18, 2010 7:31 AM