last day (26 days later) » 

07:18
Hi
08:01
hey @linguini
Hi mate, how r u?
not good for now
a bit tired
hw's about u?
@MRS1367 i'm good. Take more est buddy. WI'll catch when you have time.
i'll catch you when you have time*
I can answer ur question If I know about them
but may be I can't help u for offering sample codes in this time :)
@MRS1367 Sound good mate. How about the image auto color correction? is it possible to give me some sample code?
08:07
I said in my prev words, I can't help u for sample codes right now
I wrote some part of my codes for what u want (AutoBalance and AutoColor) but it's not completed for now
@MRS1367 Sorry. Didn't undderstand properly..my bad.
@MRS1367 ok
If I can, I'll complete it today and send it to u
@MRS1367 ok thank you. I'm working on other things like image rotate, gray scale, sepia etc.. in the image manipulaiton
I've used ImageMagick instead of AForge in my codes
@MRS1367 ok no problem. i'll import libraries to VS & i'll go through it.
08:13
so, just Download ImageMagick.NET from here:
http://magick.codeplex.com/
@MRS1367 ok, done.
@MRS1367 Thank you so much for your help & time :)
I'll happy to help ppl if I can
@MRS1367 Good :)
@MRS1367 A small question, if it's ok?
08:33
just ask it my mate
I'll check ur questions when I can
@MRS1367 it's ok mate i can manage. Please carry on with your work. If possible can i have the code by tomorrow(if possible).
just ask ur question
I'll answer it If I can
@MRS1367 I'm opening this form from another window, i'm getting a image name to display in the form Image.
public PhotoView(ImageFileViewModel image)
{
InitializeComponent();

tete = image.FileName;

var uriSource = new Uri(image.FileName, UriKind.RelativeOrAbsolute);
ViewedPhoto.Source = new BitmapImage(uriSource);

ViewedCaption.Content = image.ShortName;


imageListBox.Items.Clear();
DataContextChanged += OnDataContextChanged;


string destination_dir = destinationDirectory;
ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();
ImageFileControler.CompleteViewList(ImagesViewModel, destination_dir);
(see full text)
At the same when i select it from the listbox buy this way
 private void showImage(object sender, SelectionChangedEventArgs args)
         {

             ListBox list = ((ListBox)sender);
             if (list != null)
             {
                 int index = list.SelectedIndex;
                 if (index >= 0)
                 {

                     ImageFileViewModel image = imageListBox.SelectedItem as ImageFileViewModel;


                     if ((image != null) )
                     {
                         Uri uriSource = new Uri(image.FileName, UriKind.RelativeOrAbsolute);
(see full text)
So the question is that how can send the 'ImageFileViewModel image' to the SelectionChanged Event and display it in the Image.
I copied ur codes in a new WPF project and saved it
I check it as soon as possible
wait
It's easy to solve
@MRS1367 ok
08:48
u want to pass image variable from PhotoView method to showImage event for further use, right?
@MRS1367 yes
ImageFileViewModel urNewName;
add it in the declaration area of ur class, not in any methods or properties or ...
and add this after the final line of ur codes in the PhotoView method
urNewName = image;
@MRS1367 ok
if ur method and ur event in a class, it works
if they're not in a class, declare static variable
@MRS1367 yes. The event-handler for selectedItem in ListBox it works.
08:55
:)
Remember that; u can't pass anything to the Events in regular way
u must add new global variables for using them in Events
This is the code: ImageFileViewModel urNewName;
public PhotoView(ImageFileViewModel image)
{
InitializeComponent();
urNewName = image;

imageListBox.Items.Clear();
DataContextChanged += OnDataContextChanged;


string destination_dir = System.IO.Directory.GetCurrentDirectory() + @"./Prints/3.5x5";
ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();
ImageFileControler.CompleteViewList(ImagesViewModel, destination_dir);
(see full text)
why I can't open the StackOverflow.com today?
@MRS1367 really..it working for me.
@MRS1367 do you get any message
I can't open any webpage from it
no
it remains in loading status forever
@MRS1367 Problem with the browser may be..try with another browser..if not go for ip release renew..
09:00
I checked it with ten browsers and in all of them, I faced with same result
@MRS1367 ip release renew or reset
@MRS1367 Have u restarted your system
I open all other websites of the StackExchange.com as well
@linguini -> yes
@MRS1367 strange.
I sometimes face with this state for StackOverflow.com and after several hours, it solves
and I don't know why
@MRS1367 I had problems when there was a issue with the server, if not its fine.
09:05
wwwoowwww, after three hours, finally I could open it.
@MRS1367 excellent..finally u got it.
but, it's very weird state
@MRS1367 problem some server socket issue...
@linguini -> in my system?
@MRS1367 May be i'm not sure.
@MRS1367 Now we have a global variable and how can i pass it to the eventHandler?
09:11
just use it in where u want
just use ur new variable in ur Event in where u want
@MRS1367 I'm a bit lost here. I know that we can use this global variable any where but I want to send that to the event-handler, so it'll select the image for manipulation. 'private void showImage(object sender, SelectionChangedEventArgs args)'
Am i ocnfusing you?
confusing*
Clear Code :                                                                                                                             ImageFileViewModel urNewName;
        public PhotoView(ImageFileViewModel image)

        {
            InitializeComponent();
            urNewName = image;

            imageListBox.Items.Clear();
            DataContextChanged += OnDataContextChanged;


            string destination_dir = System.IO.Directory.GetCurrentDirectory() + @"./Prints/3.5x5";
            ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();
(see full text)
09:28
u can't send any thing to Event handlers
u only can store values in some global variables
and use it/them in ur Event Handlers when u need it/them
@MRS1367 hmmm. I want to use the global variable and force the ListBox to select the image from that variable.
in here?
ImageFileViewModel image = imageListBox.SelectedItem as ImageFileViewModel;
@MRS1367 Normally we can select any item in the listbox, based on the selected image it'll display it as a image source 'ViewedPhoto.Source = new BitmapImage(uriSource);'. So here how can we use the use the global variable. Sorry :(
09:44
first, urNewName is a sample name for changing it to any name u want
what does image variable contain in itself?
@MRS1367 yes, it'll update the value from the model.
an image path or what?
@MRS1367 ImageFileViewModel image, image Name and path.
I know
@MRS1367 It wasn't your question?
Sorry
09:50
wait. u want to set ViewedPhoto.Source to ImageFileViewModel image that u get it from PhotoView, right?
and in ImageFileViewModel u have a property for storing FileFullPath, right?
:14957816 yes. In the beginning i did a global variable like u said and assigned it to the ViewedPhoto.Source , like this:                                                                                tete = image.FileName;

var uriSource = new Uri(image.FileName, UriKind.RelativeOrAbsolute);
ViewedPhoto.Source = new BitmapImage(uriSource);

ViewedCaption.Content = image.ShortName;
But the problem raised when you select any other images it'll update with the selected image at ViewedPhoto.Source but in the ImageFileViewModel, still it contains the old value.
ImageFileViewModel u have a property for storing FileFullPath, right? yes you are correct.
and if u want to use image that has initialized by the PhotoView for ViewedPhoto.Source
just do it:
if ((urGlobalVariable != null))
{
    Uri uriSource = new Uri(urGlobalVariable.FileName, UriKind.RelativeOrAbsolute);
    ViewedPhoto.Source = new BitmapImage(uriSource);
    ViewedCaption.Content = image.ShortName.ToString();
}
urGlobalVariable refers to the name that u set for ur ImageFileViewModel global variable
@MRS1367 I agree with you & this is what i did in the beginning. Then I lost because when I selected another image the Globalvariable didn't update. For example: if i apply rotate or some other function it applied to the old image. This is what my problem.
10:20
I got a clue:
In the variable here, if want to apply any function just call like this :
string iFileName = uriSource.ToString();
then pass i to the functions, for example:

Roate90(string Filname)
{

}

Do the same in the SelctionChaneg Event handler, is it agood idea?
10:35
@MRS1367 Hi mate, i got it. Thank you. ;Sorry for the trouble once again.
11:07
@linguini -> sry. I had gone for lunch.
could u solve ur problem?
@MRS1367 Yes. Have you had good lunch.
sound good :)
@MRS1367 I have a small problem in saving the image(over writing). The image is being used by another user/process.
cuz, ur program is using it before
the best way is:
@MRS1367 yes that particular file is used by the ImageFileViewModel
@MRS1367 IO Exception was Unhanded. The process cannot access the file 'C:\Users\krangaraj\Documents\Visual Studio 2012\Projects\ImagePrintUtility\ImagePrintUtility\bin\Debug\Prints\3.5x5\Chrysan‌​themum.jpg' because it is being used by another process.
11:19
in most of the application program products of the biggest companies like Microsoft, Adobe, Autodesk and ..., when u save current project, it don't overwrite the current file that is using by the program
cuz, may be system hangs between Saving Operations and the original file will corrupt
so, the best solution is:
u create a new file with another name in same folder as original file
and after completing operations, release the file from ur codes and delete the original files
and then give its name to ur new created file
its very easy and safe solution for what u want to do
@MRS1367 ok
For example, this is my coe to save: ' currImgHandler.CurrentFileHandler.Save(saveFilname);'
So i give another name ' currImgHandler.CurrentFileHandler.Save("newimage");
yes
it's better u add some texts in the beginning or ending of the original file name
@MRS1367 How can i dispose or release from code. The entire collection of images are from "ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();"
cuz may be when u create a new file with new name in the same folder as folder of the original file
another file with same name that u've used, is exist in that folder
@MRS1367 ok
11:31
so, it's better that u use from one or more special characters like $ or ... in the beginning or ending of the neme of ur new file
@MRS1367 Ok
microsoft uses ~$ in the beginning of file names
after saving, just dispose that object
112
Q: Do you need to dispose of objects and set them to null?

CJ7Do you need to dispose of objects and set them to null, or will the garbage collector clean them up when they go out of scope?

@MRS1367 ok
@MRS1367 working on it
@MRS1367 tanks for links
Thank you*
12:24
@linguini -> could u solve it?
@MRS1367 Not exactly. I couldn't delete the file.
string fileLocation = System.IO.Path.GetDirectoryName(saveFilname);// get the selected file location
string getFileName = System.IO.Path.GetFileName(saveFilname); //get the seleceted filename
string s2 = "$" + getFileName; // add $ at front along with teh folde name
string filenamecombined = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), s2);//combine path.

currImgHandler.CurrentFileHandler.Save(filenamecombined);
ImageFileCollectionViewModel viewModel = imageListBox.DataContext as ImageFileCollectionViewModel;
(see full text)
do u face with error in this line:
File.Delete(image.FileName);
@MRS1367 yes the same error before.
@MRS1367 I think i need to use dispose() right?
12:47
@linguini -> check this:
2
Q: Need to delete a file, in use by my own app

pastapocketsI'm fiddling with a desktop gadget (a clock). It has a reflection effect underneath it that needs to be transparent, and I'm using CopyFromScreen to get the background, then just setting the form background to this. Like so (part of a "dock/undock" button): Rectangle bounds = this.Bound...

@MRS1367 I don't understand when i use the same code delete selected items in another window it works but here it don't. More over i'm displaying the image in the imagebox from memorystream.
13:20
@linguini -> can u explain more about ur last words?
When select an from listbox, i get the image and display it in the imagebox using this code: private void PaintImage()
{
System.IO.MemoryStream stream = new System.IO.MemoryStream();
currImgHandler.CurrentBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
stream.Position = 0;
byte[] data = new byte[stream.Length];
stream.Read(data, 0, Convert.ToInt32(stream.Length));
(see full text)
So everything is happening in memory stream if so then why i couldn't delete the file.
13:35
@linguini -> check these:
2
Q: Allow User to Delete File In Use By My Application?

Evil Closet MonkeyCan I allow a user to delete a file, under Windows, that is in use by my application? In my scenario I have a "quick add" directory that is monitored by my application. When it sees a new image show up it creates a new slide to display in an automated slide show. I would also like to allow my ...

13:47
Could u solve ur problem @linguini?
@MRS1367 no mate. i'm having head ache with this. I have a meeting at 4PM Paris time for another project.
ask for this problem in C# room
may be some one can help u
@MRS1367 ok Mate. I'll let you know.
@MRS1367 How is it going from your side?
I'm working on three big projects
in different PLs and technologies
@MRS1367 ok. Great!
13:52
I love programming but sometimes, I become tired for pressure of the works
:) :(
@MRS1367 I could imagine that how much u r interested in
what's about u?
@MRS1367 Still learning. I was working on XUL before then moved to C#
sounds good
@MRS1367 Hi can i pass a string to ListBox to search and then select that item. Is it possible?
14:01
I think, it's possible
check this:
2
Q: How can I programmatically select an item in a listbox?

B. Clay ShannonI have a listbox displaying items from an enum. I want to select/highlight the current value (read from a database) when the listbox displays/the form opens. This code, though: lblSelectedPrinter.Text = AppSettings.ReadSettingsVal("beltprinter"); listBoxBeltPrinters.SelectedItem = listBoxBeltPri...

1
Q: How can I find listbox item index with item value?

nazim coraklimy MessageBox.Show(listbox.Items[0].ToString()); is "abber" how can I find listbox item index 0 with "abber"?

6
A: How Can I Get the Index of An Item in a ListBox?

Neil BarnwellYou should make sure that MyObject overrides Equals(), GetHashCode() and ToString() so that the IndexOf() method can find the object properly. Technically, ToString() doesn't need to be overridden for equality testing, but it is useful for debugging.

@linguini -> how old r u?
@MRS1367 28 Older than u :)
@MRS1367 the links u have sent me are not working for me.
@MRS1367 Send this value and select the item automatically in the ListBox public PhotoView(ImageFileViewModel image)
@MRS1367 I'll tell you why? If use a global variable and ListBox selected item event then..i have to deal it twice with the image manipulation.
14:19
when do u want to select it?
after manipulation, or before it?
Once the ListBox is filled & then i'm passing this code: imageListBox.SelectedIndex = -1;
if (!String.IsNullOrEmpty(image.ShortName))
{
for (int index = 0; index < imageListBox.Items.Count; index++)
{
//string item = imageListBox.Items[index].ToString();

imageListBox.SelectedItem = index;
break;

}
}
please Press Ctrl+K friend for apply code-style
imageListBox.Items.Clear();
DataContextChanged += OnDataContextChanged;

string destination_dir = System.IO.Directory.GetCurrentDirectory() + @"./Prints/3.5x5";
ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();
ImageFileControler.CompleteViewList(ImagesViewModel, destination_dir);
imageListBox.DataContext = ImagesViewModel;

imageListBox.SelectedIndex = -1;
if (!String.IsNullOrEmpty(image.ShortName))
{
	for (int index = 0; index < imageListBox.Items.Count; index++)
(see full text)
and with this code, what do u want to do?
ur For Loop only runs once!!!
can u explain what do u want to do with this code?
I'm looking for the image.Shortname in the listbox(listbox is with Gridview columns), find the item and select the value.
14:29
and ur SelectedItem in ur imageListBox always remains to 0!!!
@MRS1367 yes
wait; u want to search through all items in ur ListBox and then
find matched item with image.ShortName;
then select it in ur ListBox, right?
@MRS1367 Yes(which is the optimum way)
for (int index = 0; index < imageListBox.Items.Count; index++)
{
    if (String.IsNullOrEmpty(image.ShortName))
    {
        break;
    }

    if (imageListBox.Items[index].ToString() == image.ShortName)
    {
        imageListBox.SelectedItem = index;
        break;
    }
}
@MRS1367 No chance of cup & tea :(. May be i'll show you the listbox code(i was mistake there is no gridview column in the listbox)
:14965773  <ListBox Name="imageListBox" HorizontalAlignment="Left" Height="430" Margin="0" VerticalAlignment="Top" Width="170"
                 SelectedItem="{Binding ImageFileName, Mode=Default, IsAsync=True}"
              ItemsSource="{Binding Path=AllImages}"
              VirtualizingStackPanel.IsVirtualizing="True"
              VirtualizingStackPanel.VirtualizationMode= "Recycling"
					SelectionChanged="showImage">

                <ListBox.ItemTemplate>

                        <StackPanel Orientation="Vertical" Height="150">
(see full text)
14:42
I only improved ur codes in order of what I said and u confirmed.
I said:
13 mins ago, by MRS1367
wait; u want to search through all items in ur ListBox and then
@MRS1367 Oh yes..i agree with you....don't mistake me. Jus english terms!
If I said it, cuz idk why did u paste ur WPF codes for ur ListBox control?
@MRS1367 During the debug, i see the image.name but it's not getting into the èof è loops.
@MRS1367 Sorry, i din't get your last pont.
point*
'if' loops
can I see ur codes completely? (if possible for u)
then I can help u
when I helped another my StackOverflow friends from Philippine (his name is Elegiac), he was sending some part of codes to my E-Mail and I was correcting them for him and I was sending it back
:14966077 public PhotoView(ImageFileViewModel image)

        {
            InitializeComponent();


            imageListBox.Items.Clear();
            DataContextChanged += OnDataContextChanged;

            string destination_dir = System.IO.Directory.GetCurrentDirectory() + @"./Prints/3.5x5";
            ImageFileCollectionViewModel ImagesViewModel = new ImageFileCollectionViewModel();
            ImageFileControler.CompleteViewList(ImagesViewModel, destination_dir);
            imageListBox.DataContext = ImagesViewModel;
(see full text)
@MRS1367 I got you mate..you got so much patience & helping mind :)
14:54
when u debug it, it runs this line of codes?
if (String.IsNullOrEmpty(image.ShortName))
{
    break;
}
@MRS1367 No
it runs this one?
if (imageListBox.Items[index].ToString() == image.ShortName)
{
    imageListBox.SelectedItem = index;
    break;
}
No
@MRS1367 I got to go for the meeting...Please leave me a message. i'll be back in 1hr. I really appreciate your help mate.
@linguini -> or it runs till it reaches to the final incremental index (imageListBox.Items.Count - 1)?
 
1 hour later…
16:17
hi buddy, i'm back

  last day (26 days later) »