Hi Jo 2,

I've just spotted this, and thought I'd point out a much simpler way of doing this

'Load your image file, essentially locking access to it
Dim BMP As Bitmap = Bitmap.FromFile("C:\Users\Jay\Desktop\test.jpg")

'When assigning to your picture box, create a new bitmap
PictureBox1.Image = New Bitmap(BMP)

'Dispose of the original bitmap, freeing up access to the file

'Speed up garbage collection, releasing your file.

I hope this helps.

Thanks for that little insite kplcjl... I shall bear that in mind for next time....

Did you like what I did there... bear... grrrrrrrr lol

Surrounded by people who are quite technically minded yet a person's nationality is determined by the colour of their profile picture as opposed to actually checking out a profile.

I wonder where I'd be from if I set it to a green hue... Ireland maybe.

If only so much thought and attention had been put into constructively criticising the source provided. It's kind of handy though because the TEFAL website I'm enrolled in keeps giving coding advice... weird?

Alas... I'm being rude...


I thought about LINQ, but if I needed to use a loop to copy the results of everyNth I may aswell just copy the values between the arrays in the loop it's self.

I was wondering if there was an existing method within the .Net frame work which will copy every nth element of an array to a differant array with an initial offset e.g.

Original Source Array (Bytes)

Original Target Array

Source Offset 1
Source Step 3

Target Offset 3

Updated Target Array

I can quite easily do this with a loop, however it would be handy if a method existed which performed this operation. Primerily the array is a single dimensioned byte array.

I'm just a kind of in awe. Just popping onto a site like DaniWeb, you seem to forget that there might have actually been some hard work involved, tears, frustration and all host of mixed emotions. You forget that Dani isn't just a binary baby born from the loins of a floppy drive but actually started out with an idea, a pretty hairy design and then worked her ass off, no doubt with the support of friends and the community to mature a grow the site to what it is today.

It's been a massive eye opener for myself, just a quick snapshot of Dani's work the historic screen dumps of DaniWeb has completely al;tered my perspective on a couple of things. 1. What can really be achieved through hard work and actually giving a shit about what you are doing, and 2. The individuals behind sites like this aren't just fat cats with dollar signs in their eyes, their real people, with real dreams, and real goals.

I keep talking about Dani in the third person, I know you're reading this Dani, I'm afraid I just don't know how to wriute this without talking about you and to you at the same time.

Regardless, I just want to say I'm respectfully proud of you, and what you've done, and I'm infinatly grateful to you for providing us with this pretty kick ass service.

...And no I'm not forgetting all the Mods, Admins and the community it's self, every one ...

Dani commented: Thanks so much! +0

Awwww looookkkk how cute it was... OMG what an incredible journey



Planet of The Apes

Hey, I was just wondering, If you have any old screen dumps of DaniWeb roughly around the time when it kicked off. I'd love to see what now and then looks like in comparison.

Do you think you have anything Dani?

Their the badgers... thanks guys.

Is there any way I can delete these Drafts myself, or is this a request to the MODs?

Oh my god... I must be smoking crack... Somehow I always thought this was the bottom of the page


But look, there's even more BWahahahaha...


I swear to god I've never seen that bit what the hell man... look there's a little JC badge too whoop... I must of just assumed the dim gray box was the footer and stopped scrolling automatically. GOSH DARN IT.

Re-Write blowfish for .Net:1
Navigate Web Browser:0

Hi Dani, thanks, I managed to get help understanding that. What I am really trying to find is the following. Once I've clicked on "publish" i Get this screen with the link at the top "View Article Workshop"


Then when I click on the link I get the list of pending and draft articles:


as you designed and built the website you'll be all to familiar with this =0) however, my question really is, once I've left this page, how do I get back to this Article Workshop View list, If I save a draft I can't seem to figure out how to get back to it at a later date... also, like here I've created a bunch of tests... which would be kind of cool if I could just click on a littel trashcan or something to delete them.

First of all I'd like to say great work on the addition of drafting articles before commiting to editorial however one question. The last two samples I published (Removed tick from "This is a working draft") seems to make the pending article unaccessible, I recently found out that the articles had been submitted for checking which is cool, however I couldn't find them any where, to get access to these articles I had to create a new article, then save as draft wich gave me access to a list of draft and pending publishing articles.

Is there a way to access this Draft\Pending list to re-edit at a later date, if so where it it. I think the link i saw was something like "upcoming articles"


Assuming you are passing the same instance of stream to each of your Addxxx methods then yes it should work. However I think you need to do this using (CryptoStream crStream = new CryptoStream(stream, cryptic.CreateEncryptor(), CryptoStreamMode.Write)) only once at the start of the entire write process for all of your methods, not in each method.

Also, GoTo exits the loop meaning the conditions within that particular loop will only ever be true once. I can see that this is in another loop but it's not clear from here what for.


[Whispers] I hope he's making a demo which physically moves the mouse pointer then clicks the button, which doesn't render my answering only the first half of the question entirely pointless [/Whispers]

The File.OpenRead, is as you have pointed out locking the file access mode to read only, you should probaly just use Open, which is read\write.

When writing your stream, the position within the stream doesn't seem to have changed position, so any writing will occour from the first byte, overwriting exiting data.

However, looking at this it doesn't look like your file will have any pointer references each time you append data to your file. A new crypto stream will be written each time you write to the file, or indeed append the file however you will end up with a whole bunch of encrypted data chunks, with no reference in length for each one.

I would assume you would have to read all the data of the file, decode it, append the new data, encode it again then rewrite the files contents as a whole.

Wow, I didn't know GoTo was still valid, please stop that.

Well first of all, the flow of this entire operation is a little shaky, however looking at this:

                If LVProduct.Items(w).SubItems(4).Text = LVProduct.Items(w).SubItems(5).Text Then
                    GoTo Here
                End If
                If LVProduct.Items(w).SubItems(4).Text = LVProduct.Items(w).SubItems(5).Text Then
                    GoTo there
                End If

Both conditions are exactly the same so if the conditions are correct it will always goto Here, and never there.

in fact GoTo there will never be called, Here seems to be where your Whole sale stuff is... Wholesale is always going to be called if the above conditions are correct.

Also not understanding what your check boxes are doing and when, there is a chance when you GoTo Here, there's code will be executed afterwards.

When you found GetCursorPos in ther User32.dll, did a little bell not tinkle to the sound of maybe SetCursorPos? =0)

I'm a cheeky chap

Public Declare Auto Function SetCursorPos Lib "User32.dll" 
    (X As Integer, Y As Integer) As Boolean

Private Sub Button1_Click(sender As Object, e As EventArgs) 
    Handles Button1.Click

    SetCursorPos(50, 50)

End Sub

There you go, so close my friend.

Have you figured this out yet? You seem to have quite a few things to research but if you still need some help just say.


Should be

Convert.ToDateTime(dataGridView1.Rows[i].Cells[0].Value).ToString("yyyy-MM-dd HH:mm:ss.fff")

Darn it VB....

Oh shucks... I just saw MySQL... Sorry. Ok, so you can ignore the data acquisition part, however the binding between your DGV and DTP will still be the same.

Ok, Let's assume the following table:


And the following code in your Form1 class:

        SqlConnection sqlCon;
        SqlCommand sqlCmd;
        String conString = "Server=SOLVOTERRA-HP;Database=Birthdays;
            Integrated Security=true";

        DataTable dTable;

        //DGV Cell Content Clicked Event
        private void dataGridView1_CellContentClick(object sender, 
            DataGridViewCellEventArgs e)

            //Clear Previous Binding

            //Reset New Binding
                dataGridView1.DataSource, "Birthday");


        public Form1()

            //Create New Connection
            sqlCon = new SqlConnection(conString);

            //Create New Command
            sqlCmd = new SqlCommand("SELECT * FROM Person", sqlCon);

            //Create New Data Adapter
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sqlCmd);

            dTable = new DataTable();
            dTable.TableName = "Results";

            //Fill The Table With Your Data

            //Close The Connection

            //Set The DGV's Data Source To The Table
            dataGridView1.DataSource = dTable;


Even though the date time stap formats don't match this wont raise an exception, in fact clicking on the row will update the DTP's value:


As the DTV is bound to the DGV, updating the DTP's value will also update the DGV. Though this wont effect your database directly.


Oh No, not another LockBits demo. Well hopefully this demo may also give you a little in site into actually playing with, and calculating some simple effects as well as understanding the advantages of LockBits as apposed to GetPixel and SetPixel.

A Useful Note.

It is important to note that using LockBits is only effective beyond a certain point. Bench tests show that if you manipulate below roughly 60 to 70 pixels in one go, you are in fact better off using GetPixel and SetPixel. Why? Well basically the time allowed for locking bits and unlocking bits, as well as copying all the byte information needs to be considered when making these calculations. Much below 60 or 70 pixels, this time taken exceeds the time taken to simply use Get or Set Pixel.

This can be explained in more detail Here

So What Do We Have Here Then?

  1. Wrapping up Lockbits and associated methods into a more manageble class.
  2. Applying Filter effects to your images.
  3. Playing with the Alpha Channel.
  4. Mimicing Opacity.
  5. Overlaying Images (Layering).

Below you can see the interface which will allow you to manipulate the images, quickly in real time:

** The left hand image, and sliders will allow you to manipulate the saturation of each colour channel in the image, essentially removing a colour from an image.

** The center image shows the left image combined with the right hand image. This image doesnt relay ...

ddanbe commented: Nice tutorial +15

=======Download The Full Solution Below========

This will be my last VB.Net soure as I've made the move to C#. For a recent job application I was given the technical test to create a horse race simulator which would calculate the odds of a runner winning a race of up to 16 runners, then ensure the runners were within a 2% winning margin of there expected win percentage after 1,000,000 races. I got the results between 0.10% and 0.02% but never got offered the position as my solution was "Beyond Requirements".


This solution is host to ll sorts of goodies including multithreading, basic user controls etc... further more, if you bet on the horses this may be great for you.


=======Download The Full Solution Below========

Without going too far in to this have you tried serializing your data response into an object structure, or using LINQ?

If serializing or LINQ doesn't make any sense then don't worry too much about it, I may be missunderstanding your requirement.

How on earth have I not come across ReadOnlyCollection<> before?

Every day's a school day.

ReadOnly... Always made me laugh, you can't assign a new X to it, but you can manipulate all the content of X... Wow!