J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

ddanbe has provided two great examples of reading the Excel sheets. And This Link directly from IBM shows you how to parse a DataTable into DB2 it's in C# but easy enough to translate.

Job Done =0)

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Thanks Diafol. Just what I needed to know.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Hey guys. I'm writing myself an online toolbox (for my code snippets). I have a "Snippets" table. My question is this. Would you save the snippet source in a Text column or would you have the snippet saved to a text file and the Snippet entry would reference the file name?

e.g. Snippets or Snippets2

66d53b10f23ce24db08dffd799cf70e2

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Could you not parse the spreadsheet via a DataTable first? SpreadSheet -> DataTable -> DB2

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Using .Net's SHA1 Crypto Service to compare hashes between a user's password and their stored hashed password.

Simplez =0)

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Are the colours of the object solid? If so maybe you could check the point under the mouse. Other wise it'd be a mathmatical hit test.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

So am I right in assuming, you preferance is:

  • Delete Image Entry from Images
  • Check Image_Has_People for entries with the deleted idImage
    -- Delete Relevant Images
  • Check Image_Has_Event for entries with the deleted idImage
    -- Delete Relevant Images

or even

  • Check Image_Has_People for entries with the proposed deleted idImage
    -- Delete Relevant Images
  • Check Image_Has_Event for entries with the proposed deleted idImage
    -- Delete Relevant Images
  • Delete Image Entry from Images
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

2680a256fcbf10c900499c36825b3e55

In the above model I have an Images table which holds all the filenames relevant to the image. I have two relationship tables (Image_Has_People and Image_Has_Event). Both of these tables have an FK ImageID linked to the Image table's PK idImage. I'm wondering, if I set both relationship table's ImageID FK to On Delete Cascade, If I delete an entry in one of the relationship tables will that not also delete the image table entry too?

What would I need to do in order that when I delete an Image entry from the Image table it also removes relevant entries in the two relational tables but not vice-versa?

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I'm really confused by this, by Short do you mean sort, and if you mean sort, can't you just do this

Dim iVals As Integer() = {1, 9, 3, 10, 6, 2, 8, 5, 7, 4}
Array.Sort(iVals)

If you wanted to reverse the sort order

Public Class ReverseComparer : Implements IComparer
    Function Compare(x As Object, y As Object) As Integer _
            Implements IComparer.Compare
        Return New CaseInsensitiveComparer().Compare(y, x)
    End Function
End Class

'Button Click Event

Dim RC As New ReverseComparer

Dim iVals As Integer() = {1, 9, 3, 6, 2, 10, 15}
Array.Sort(iVals, RC)

Display the results

For Each Val As Integer In iVals
    Console.WriteLine(Val)
Next
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I think The tables may be missleading. The Album Table is the main table which will be queried when looking for photos eg

SELECT idPhoto FROM Album WHERE idEvent = 8 (First Dance)

then to get people tagged

Select idPhoto, idPeople From Tags Where idRoll = 4 (Bridesmaid)

I then think id do the JOIN INNER thing with these two tables to get images of only the bridesmaid at the first dance?

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Is the category table you talk of not my "Event Table" in the model?

The crosswalk bit (I'm not sure what that is) but is it something like:

    idPhoto     idTag
    9           1
    9           2
    9           3
    9           4
    9           5
    9           6
    9           7
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Hi guys, I'm currently on the pretty cool Database development path. I've quickly got to terms with basic SQL with individual tables, and various queries. Now things seen to be getting a little beyond a concept I had been taught from a young age.

Am I doing this right. The images are in Excel for display purposes but this reflects my modal.

76105a85f97926f079029dee605d9375

I then have a tables which holds data like who the subjects are and who the focal subject is

1f4fe4328a1bcb265a923dd5bf16b377

However in this TagTable I am repeating entries eg. idPeople 3 (Rachel) she is a bridesmaid and a musician, so she has two entries. idPeople 5 (Lorna) has three entries because i've classed them as Mother, PArent and family. Not only that, all these entries are for one photo (idPhoto9)

1st, Guys Am I Doing This Right Before I Get Too Deep?
If I Am Getting Things Roughly Right Then,

lets say, I want a table with the bridesmaid at the firstdance. would my query be something like a JOIN INNER to compare results from the TAG table and ALBUM table. What I think I do is get a results table which consits of all images including the Bridesmaid, I then query that results table with a JOIN INNER query against the ALBUM table to return results that only have the bridesmaid in the first dance event?

Final Question

Now I want to return all photos at location Chapel. …

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

This wee snippet is for inspiration not solution. Planting the seed of solution can often be more effective than providing a solution its self dont you think

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I was just mucking around with a progress feature for some software, and thought I'd just put this wee demo up of a clocky type progress thing =0)

Just Copy and paste the form code and watch it run. (p.s it's in degrees, note minutes and seconds)

55f1addda67a729e91ae90c980c39deb

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

My Pleaseure.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

If thae parsing fails, you wont have any results so trying to access MyResults.Results(0) will "result" in an error as a result object hasn't been added to the results list.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Ok, the first part of the structure is ok, so here's the Geometry bit:

The Complete Code Is At The End

In geometry you have a few properties, let's make a simple textified version:

-bounds
--northeast
---lat
---lng
--southwest
---lat
---lng
-location
--lat
--lng
-location_type
-viewport
--northeast
---lat
---lng
--southwest
---lat
---lng

From the above structure you can see there are a couple of properties, some of which the structure is repeated. so the base structure for geometry would have the following properties

bounds
location
location_type
viewport

viewport and bounds have the same sub properties

northeast
southwest

and those sub properties, as well as location have sub properties

lat
lng

so create a LatLong Object

Public Class LatLong
    Public Property lat As String
    Public Property lng As String
End Class

New we'll create a Coords object for northeast, southwest

Public Class Coords
    Public Property northeast As LatLong
    Public Property southwest As LatLong
End Class

and the actual GeometryData object

Public Class GeometryData
    Public Property bounds As Coords
    Public Property location As LatLong
    Public Property location_type As String
    Public Property viewport As Coords
End Class
Object Structure

So your complete structure now looks like this

Public Class MyResults
    Public Sub New()
        results = New List(Of Result)
    End Sub
    Public Property results As List(Of Result)
    Public Property status As String
End Class

Public Class Result

    Public Sub New()
        address_components = New List(Of AddressComponents)
        types = …
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Of course you can. Am I right in assuming that you've got a good idea of what's going on, you're just having difficulty in matching the structure? I'll keep my eyes on this thread and have a look into this whilst waiti9ng for your response.

Just out of interest, do you have your current effort available to post so I can also see if you're not to far away from your solution?

BAre with me, I'll have a play in the mean time.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Note: The calculation at line 16 rounds to the nearest integer (up or down). assuming you are going to allow rounding up (Not very business minded I know), you may want to replace line 16 with the following code

'If the Minute value is > 95% then increase the hour by 1
If CInt((10 / 60) * Diff.Minutes) > 9 Then
    Return Diff.Hours + 1 
Else
    Return Diff.Hours & "." & CInt((10 / 60) * Diff.Minutes)
End If

Oherwise if you are business minded replace line 16 with the following to always ROUND DOWN to the nearest 10%

Return Diff.Hours & "." & (CInt((100 / 60) * Diff.Minutes)) \ 10
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

If you're going to point out the difference between VB6 and VB.Net, it may be useful to provide some useful methods provided by .Net. This simple function using Date,Time and TimeSpan will return the hours worked and minutes in 1\10 intervals.

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

        Console.WriteLine(CalculateDailyHours("29/10/2014 17:00", "30/10/2014 03:12"))

    End Sub

    'Make the returned value a double so it can easily be used for future calculations
    Private Function CalculateDailyHours(StartValue As String, EndValue As String) As Double

        Dim StartTime As DateTime = BuildDateTime(StartValue)
        Dim EndTime As DateTime = BuildDateTime(EndValue)

        Dim Diff As TimeSpan = EndTime - StartTime

        'Get The Hour Difference and The Minute Difference in intervals of 10%
        Return Diff.Hours & "." & CInt((10 / 60) * Diff.Minutes)

    End Function

    Private Function BuildDateTime(DTValue As String) As DateTime

        Dim vDate As Date = DTValue

        Return New DateTime(vDate.Year, vDate.Month, vDate.Day, vDate.Hour, vDate.Minute, 0)

    End Function

The returned value is 10.2 as a double

ddanbe commented: Good! +15
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

After trying to manipulate PNG files and failing miserably discovering that the standard GDI doesn't provide support for any PNG parameters decided to provide some basic image manipulation functions built into .Net that I came across on my investigations.

1. Adjust Image Quality
2. Flip Image Horizontally
3. Flip Image Vertically
4. Rotate Image (90 Degree Step)

This Source Uses 4 buttons, A HScrollBar and A PictureBox.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

You're welcome. I hoped it's helped.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster
Sorry, I'll try that again...

-------

Looking at your provided JSON string it looks like the property name is long_name >"long_name" : "Sunderland"

for example, if you set your structure up correctly you would access it by the following

Dim Town as string = MyResults.results(0).address_components(1).long_name

If you have trouble with this I will be happy to provide you with further assistance.

to get you started you would begin with the follwoing structure

Your base class may look something like this:

Private class MyResults
     Public Sub New()
        results = New List(Of Result)
    End Sub
    Public property results As List(Of Result)
    Public property status As String
End Class

Your Result class may look like this

Private Class Result
    Public Sub New()
        address_components = New List(Of AddressComponents)
        types = New List(Of String)
        geometry = New GeometryData
    End Sub
    Public property address_components As List(Of AddressComponents)
    Public property formatted_address As String
    Public property geometry As GemoetryData
    Public property partial_match As Boolean
    Public property types As List(Of String)
End Class

Your AddressComponents object may look like this:

Private Class AddressComponents
    Public Sub New()
        types = New List(Of String)
    End Sub
    Public property long_name As String
    Public property short_name As String
    Public property types As List(Of String)
End Class

Do you see how you're building an object structure to match the structure of the JSON string. The geometry class would be a little more complicated, but the same principal.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Looking at your provided JSON string it looks like the property name is long_name >"long_name" : "Sunderland"

for example, if you set your structure up correctly you would access it by the following

Dim Town as string = results.address_components(1).long_name

If you have trouble with this I will be happy to provide you with further assistance.

to get you started you would begin with the follwoing structure

Your base class may look something like this:

Private class MyResults
    Public results As List(Of Results)
    Public status As String
End Class

Private Class Results

    Public address_components As List(Of AddressComponents)
    Public formatted_address As String
    Public geometry As objGemoetry

End Class

Your AddressComponent object may look like this:

Private Class AddressComponents
    Public long_name As String
    Public short_name As String
    Public types As List(Of String)
End Class

Do you see how you're building an object structure to match the structure of the JSON string. The geometry class would be a little more complicated, but the same principal.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster
BlowFish?

BlowFish was the brain child of Bruce Schneier back in 93. Since BlowFish was released to the public domain, Bruce Schneier has released new encryption algorythems, TwoFish and ThreeFish. BlowFish is an increddibly popular and very strong algorythem. Because it conforms to Kerckhoffs's Principal Explained Here, even though the algorithem is public domain, it still isn't crackable without the key.

It Isn't Mine, I Just Converted It.

I'm far from a maths genius, far, far from it. My only involvement in this class is converting from VB6 and wrapping. I have tried to comment the parts of the algorithm that I understand, much beyond that I'm afraid you'll probably have a better understanding than I.

I have wrapped the class up nicely so there is little more then Encode, Decode and Key available to the user. I have also included as much error handling as possible.

Share and Share A-Like

There are many, many examples of BlowFish out there, in all kinds of languages, but not VB.Net. With that in mind, I decided to share this conversion so there is at least one VB.Net version out there... And where best to host it, but on DaniWeb. Obviousley in accordance to the aforementiond Kerckhoffs's principal, I'm not jeopardizing the security of this algorythem, however it may be worth playing around with the intialization values to ensure your Boxes are unique.

The code provided is a guide how you can use the Class. Very simple.

Jay

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I just don't get this one Jim, apart from a whole bunch of un-needed code... batoolhussain's, yours, and even:

        Dim pic As Bitmap = New Bitmap(PictureBox1.Image)
        Dim gray = New Bitmap(pic.Width, pic.Height)

        For x As Integer = 0 To (pic.Width) - 1
            For y As Integer = 0 To (pic.Height) - 1
                Dim c As Color = pic.GetPixel(x, y)
                Dim d As Integer = (CInt(c.R) + CInt(c.G) + CInt(c.B)) \ 3
                gray.SetPixel(x, y, Color.FromArgb(d, d, d))
            Next
        Next

        PictureBox2.Image = gray

Should all work. I can only assume there's a dodgy property somewhere?

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

There is no reason why this code shouldn't work. To speed things up a little move PictureBox2.Image = gray outside of the two for-next loops.

try creating a new form, with a picturebox (Change no properties) and the button. place the code in the button and load an image into the picture box's image property and try running again.

I've just copied and pasted your code into the above scenario and it works.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Though instead of typing out all those properties like that just for a couple of bits of data you may just want to structure your properties like this

Public Property bytes As Long
Public Property is_dir As Boolean

etc

Note The property name and the object structure has to match the JSON names and structure.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Have you tried parsing the JSON into an object structurte? here is a JSON string from a DropBox list files Query:

{"hash": "2e50103f8605f7639f7da0fd2e934fe4", "thumb_exists": false, "bytes": 0, "path": "/", "is_dir": true, "icon": "folder", "root": "app_folder", "contents": [{"rev": "5929d57df1", "thumb_exists": true, "path": "/flower.jpg", "is_dir": false, "client_mtime": "Mon, 15 Sep 2014 19:20:02 +0000", "icon": "page_white_picture", "bytes": 879395, "modified": "Mon, 15 Sep 2014 19:20:01 +0000", "size": "858.8 KB", "root": "app_folder", "mime_type": "image/jpeg", "revision": 89}, {"rev": "829d57df1", "thumb_exists": false, "path": "/test.xlsx", "is_dir": false, "client_mtime": "Mon, 08 Sep 2014 12:50:47 +0000", "icon": "page_white_excel", "bytes": 21699, "modified": "Mon, 08 Sep 2014 12:50:47 +0000", "size": "21.2 KB", "root": "app_folder", "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "revision": 8}], "size": "0 bytes"}

A bit of a mess like this. However once you've determind the structure you can create an object structure like this

 Public Class dbFiles

        Private _contents As List(Of dbFile)
        Public Property contents As List(Of dbFile)
            Get
                Return _contents
            End Get
            Set(value As List(Of dbFile))
                _contents = value
            End Set
        End Property

        Private _hash As String
        Public Property hash As String
            Get
                Return _hash
            End Get
            Set(value As String)
                _hash = value
            End Set
        End Property

        Private _thumb_exists As Boolean
        Public Property thumb_exists As Boolean
            Get
                Return _thumb_exists
            End Get
            Set(value As Boolean)
                _thumb_exists = value
            End Set
        End Property

        Private _bytes As Long
        Public Property bytes As Long
            Get
                Return _bytes
            End Get
            Set(value As Long)
                _bytes = value
            End Set
        End Property

        Private _is_dir As Boolean
        Public Property is_dir As Boolean
            Get
                Return _is_dir
            End Get …
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I almost forgot to mention LINQ too... really cool, powerful stuff. This is amazing, you can query XML, SQL, Object Structures, Lists, Collections etc Click Here

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I've just gone through all this myself. It was great. Here were my steps for my particular approach. (Links Below) Note: This was just my recent research into MySQL, there are other alternatives.

First there are a few DBMS or RDBMS <--- Learned that too. MySQL Workbench, MS SQL Server, Oracle etc

I chose to Use MySQL, so I downloaded SQL Server which runs nicely as a service in the background. I also have MySQL Server running on my server (For remote testing) and installed MySQL Workbench for additional testing and development.

I then downloaded and installed SQL Connector for VB.Net, which lets me easily connect to MySQL databases.

After that I bought a SQL book which gave me all the commands I need to play with.

I then checked out Microsoft's Virtual Accadamy on database fundamentals

I'm Having great fun.

So in this order i did the following
  1. Watched and learned the fundamentals of databases on MSVA Click Here These guys are using MS SQL Server (T-SQL etc) which has some slight SQL variations

  2. Bought this book for SQL commands (Superb by the way) Click Here

  3. I then got my hannds on MySQL Server This page gives you links to MySQL, MySQL Workbench, and the VB.Net Connectors Click Here

It took a couple of days to figure everything out, but now it's all fine and dandy.

Note: if you don't want to have to install the MySQL Server then you need to …

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Did you know that you can data bind a bitmap to a PictureBox's image property, and the source image doesn't have to be in a binary format stored in a data table?

Using a standard object setup for data binding (iNotify etc.) you can easily update your program's image propertie's from one place.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I love this stuff, brings back the good old days. It's not even a "Complete Game" still I spent a good five minutes pinging balls all over the place.

oussama_1 commented: awesome..10x for your comment +4
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Ok, that's good...

Then it's you that's doing something wrong.

Download the solution below, it is the same code in action. I have modified it slightly to ensure the pan doesnt go beyond the boundries of the image.

I have to stress though, panning and zooming an image this way just isn't cool beans, however... it seems to be a popular aproach by... people.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

is your picturebox inside a panel?

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I'm assuming... oddly once again you just want to pan the picturebox inside your panel, using the panel as a clipping device... Here, this is the panning code you need.

    Private mDown As Boolean = False
    Private oPoint As Point = Nothing
    Private offPoint As Point = Nothing

    Private Sub PictureBox1_MouseDown(sender As Object, e As MouseEventArgs) 
        Handles PictureBox1.MouseDown

        If mDown = False Then
            mDown = True
            oPoint = New Point(Cursor.Position.X - (Panel1.Left + Me.Left),
                               Cursor.Position.Y - (Panel1.Top + Me.Top))

            offPoint = New Point(PictureBox1.Left, PictureBox1.Top)

        End If

    End Sub


    Private Sub PictureBox1_MouseMove(sender As Object, e As MouseEventArgs) 
        Handles PictureBox1.MouseMove

        If mDown = True Then

            PictureBox1.Left = offPoint.X - (oPoint.X - (Cursor.Position.X -
                                                         (Panel1.Left + Me.Left)))

            PictureBox1.Top = offPoint.Y - (oPoint.Y - (Cursor.Position.Y -
                                                        (Panel1.Top + Me.Top)))

        End If

    End Sub
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Brilliant. Thanks.

Two more books I need to pur-chase dang it!

One last question based on these two technologies, is there anything I need to be aware of server-side-requirents wise?

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Fortunately this is not a projdect I'm starting anytime soon, this is me preparing myself for said future project\requirement.

Would you be able to provide a one sentance description of what WCF and ASP.NET does\is and what their roles are.

Basically a dummy description if you will for my brain to latch onto.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Hi WebDev Guys,

Ok, I have a very general question as the title suggests. I am very much a back-end developer and have only dabbled in web development. I would consider myself a total ammature when it comes to Web Development though am confident after playing with PHP, JavaScript, JQuery, HTML5 and CSS3 and with my Android\VB.Net and Java ecxperience should be able to get a grasp of things behind the scenes quite happily.

This is where I'm at at the moment A Simple Demo I think I've figured out how to use Divs and basic CSS3 but am now looking for direction in the following fields. (Note: My front end design skills are appauling with any technology, server or client)

I'm not looking for source guys, just direction in what technologies you think I need to persue in order to achieve the following.

I don't know where to start? I'm going to throw some words around in hope you guys will know better then I, what I'm actually talking about.

One Database online, Two Access Methods

  1. Web Access
    The user can login, manage settings, preferences, account information etc online

  2. PC Software Access
    There can be a "back-office" PC\Android based piece of software which can access this database. Even a user based pieve of software which let's them access their data from the sever database.

What I seem to be missing is the technology (ideally a single one ASP.NET?) that links Web-Server Database-PC …

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Where's Walley Easy:

454850e0d8da1800414ba8ab7c268b3d

Where's Walley Medium:
8f18b339ef1742230854e2cbda54ef38

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

NOTE: The games GUI is not fully implemented, so changing it's image and difficulty is done manually in the Button.Click Event

NOTE: Whether you download the VS2013 source file or copy and paste the code, you need to download, and extract the two image files to the project's "Bin\Debug" directory.

If you copy and paste the source ensure your form has the following controls:

Button (Button1)
PictureBox (Name:pbGameBoard, Width:792, Height:792)

THE GAME

This is a fun example using graphics. It is a representation of the classic tile slide game, where you slide the tiles around to make the picture. This version is a little different. There are Tiles and Sub Tiles. The Tile Grid is 9 x 9. Each Tile has a 9 x 9 Sub Tile Grid.

If you set the game to Easy then only the main Tiles are scrambled. If it is set to Medium then not only are the Tiles scrambled but so are their sub tiles.

Instead of sliding the tiles around, this game is actually switching tiles\subtiles with the adjacent tile\subtile. Subtiles cannot be switched with subtiles from a different tile.

HOW TO PLAY

To Start A New Game:
Click your button

To Move Tiles:
Select the center SubTile of The Tile you want to move. The SubTile will be selected in Green. Move the mouse to the center SubTile of an adjacent tile and the cursor will turn yellow. If you click now, the two Tiles will be switched.

Image …

Begginnerdev commented: Very nice post! +9
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Take Heed

There are lots of things to be aware of with the Windows Registry. In most cases the best thing to be aware of is that ideally you should avoid playing with it at all costs. Alas, we are what we are and we do what we do. My advice to you is to make a back up of your registry. Remember though, values are read and written continuousley without our knowledge, and reverting to a backup made 10 minutes ago may not reflect your current systems settings so be careful.

Backup Your Registry

Start RegEdit, Search for RegEdit in either the run or search box in your system's start menu. Once you have opened RegEdit goto menu Start>Export. In the save dialog box you will see a group box titled "Export Range". Select the "All" radio, choose your destination and file name and hit export.

Using Visual Studio to Create Your Icon Association

If you would prefer a much safer option, use VS's Extension Manager. Properties>Publish>Options>File Association. The headings of each field reflect the const values in the source provided.

Using This Source (Assumes)

I have told this association to use the current project's executable Icon, so you need to set a default icon for your project. You can point to any .ico, .dll, .exe you wish, but remember that the referenced object needs to be available, in the same location on the users computer too.

In With the …

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Your going to have to program the code logic based on the mouses x and y position. To get the relevent mapdata from the mouse position you would simply do MapData(Mouse.X\32,Mouse.Y\32) this will return what kind of tile the mouse is over.

Apart from writing the game for you that's pretty much it... and no I'm not writing the game for you =0)

please do not be lazy like this video... Live, Love Code.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Infact, the code is so simple I can post it here too. Extract the Zip file below and add it as a resource to your project then paste this code.

Public Class Form1

    Dim MapData(19, 19) As String

    'DOUBLE CLICK ON LEVEL1.LEVEL TO VIEW ITS CONTENTS

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        'Because I've included a res file I've had to read this data, all you would
        ' do with a file is read it line by line and split each line with ","

        'POPULATE MAP DATA FROM LEVELDATA (Level1.Level)

        'Get The Resource File Text
        Dim strLevelData As String = System.Text.Encoding.UTF8.GetString(My.Resources.Level1)

        'Split The String By VBCRLF (This will get our rows (Like ReadLine)
        Dim MapDat As String() = Strings.Split(strLevelData, vbCrLf)

        Dim Tiles As String()

        '(-2) because I think I did the map data file too large

        For MapY As Integer = 0 To MapDat.Length - 2

            'We Split Each Row\Line By The ,
            Tiles = Strings.Split(MapDat(MapY), ",")

            For MapX As Integer = 0 To 19

                'populate The MapData element with the relevent Map Data
                MapData(MapX, MapY) = Tiles(MapX)

            Next

        Next

        DrawMap()

    End Sub


    Private Sub DrawMap()

        'Create A board bitmap
        Dim Board As Bitmap = New Bitmap(32 * 20, 32 * 20)
        'And a graphics object
        Dim G As Graphics = Graphics.FromImage(Board)

        'Iterate through each value of your mapdata
        For y = 0 To 19
            For X = 0 To 19
                'and draw the relevant image at the relevant x\y location
                G.DrawImage(ImageList1.Images(CInt(MapData(X, y))), New Point(X …
J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

Here, Have a look at this. I still can't believe that example... the s***t that gets published on youtube.

29e844d1741d786ae872bfd545e1cb0f

Becomes

5ecc1ea94f486e5d4ac3337b1fd7d7ae

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

ok that guy is totally wrong DO NOT COPY THAT. I'll have the example for you in 5 mins.

I can't believe that video, it is such a bad way to do it.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

the only reason I suggested this would be you could easily upload a new level to your server eg Level69.level. Your program could check for files it didn't already have. Assuming you kept the level file name in a specific format the game would know in which order the levels would increment eg(Level69 comes after Level68)

I can't resist, give me a second I'll build you an example.

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I was only remembering the old days. I don't know how you've saved your map data, or what format it is.

However what I was demonstraighting above was. Imagine you have two square images let's say 32 pixels by 32 pixels. One image 1 is a wall tile, Image 0 is a floor tile. If you look at the "Array Data" abouve, and look closely it represents a very basic pac-man style maze you can follow the 0s round with your finger. When the program reads the test file, it draws the relevant tile based on the arrays location and value. It might look something like this

lets say the map tile area 100 by 100 and the tile images dimensions are 32x32. Lets imagine the map data is stored in an array (Like Above) MapData(100,100) and you have two images in an ImageList called MapTiles. MapTiles.Images(0) = Floor Tile, MapTiles.Images(1) = Wall Tile

Image You Have A Function That Draws A Tile called DrawTile(Image, XPosition, YPosition) which draws the image "Image" at position "XPosition", "Yposition"

for X = 0 to 99
    For Y = 0 to 99

        DrawTile(MapTiles.Images(MapData(X,Y)), X x 32, Y x 32)

    Next
Next

you would now have a table\grid\map 3200pxls by 3200pxls where ever a 0 was in your array there would be a floor tile, wherever there was a one a wall tile

like I say this is ooooooold school 2d game development stuff.... when it was fun

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

(This isn't an answer, just reminising) I remember when I used to make oooooold games like packman etc (2d) the map data was stored in a simple 2d array. One of the easiest methods known to man. There were different arrays fo each level, one held floor\wall data, others held special event data, buttons, traps, teleports etc eg as basic as it get's 1=wall 0 = floor 6=teleport

1111111111111111111111111
1600000000000000000000001
1010111111111111111110101
1010000000000000000000101
1010011111110011111110101
1010010000000000000010101
1010010011110011110010101
1010010010000000010010101
1010000010000000010000101
1010010011111111110010101
1010010000000000000010101
1010011111111111111110101
1000000000000000000000061
1111111111111111111111111

Are those days really gone? boooooooooooo

each level was a simple text file called Level1.level, level2.level

J.C. SolvoTerra 109 Eat, Sleep, Code, Repeat Featured Poster

I like it here Jim, there's some good characters.

Currently working on a generice company freeware title which I'm going to publish but post the source on here "Show off your projects". I think there's a bunch of useful snippet's which I think the community may like to use.