<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Eyal Albert</title>
        <link>http://geekswithblogs.net/EyalAlbert/Default.aspx</link>
        <description> </description>
        <language>en-US</language>
        <copyright>Eyal Albert</copyright>
        <managingEditor>Eyal.albert@Gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Eyal Albert</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/EyalAlbert/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>VWG Control Designer and Theme Designer</title>
            <category>VWG</category>
            <link>http://geekswithblogs.net/EyalAlbert/archive/2009/03/03/vwg-control-designer-and-theme-designer.aspx</link>
            <description>&lt;p&gt;Guy Peled the CTO of Gizmox published an announcement about the new Control and Theme Designer. The new designer simplifies the way to create a Custom control and theme to a &lt;a title="Visual WebGui" href="http://www.visualwebgui.com/" rel="Visual WebGui" target="_blank"&gt;Visual WebGui&lt;/a&gt; application.    &lt;br /&gt;You can read it &lt;a href="http://www.visualwebgui.com/Developers/Forums/tabid/364/forumid/55/threadid/21501/scope/posts/Default.aspx" target="_blank"&gt;here&lt;/a&gt;.     &lt;br /&gt;This is just the first stage of the designer the future versions will give it more power and ability in designing and editing.     &lt;br /&gt;I will publish a demo on how to use this designer before the preview version is out. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129804"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129804" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/EyalAlbert/aggbug/129804.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Eyal Albert</dc:creator>
            <guid>http://geekswithblogs.net/EyalAlbert/archive/2009/03/03/vwg-control-designer-and-theme-designer.aspx</guid>
            <pubDate>Tue, 03 Mar 2009 14:35:20 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/EyalAlbert/comments/129804.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/EyalAlbert/archive/2009/03/03/vwg-control-designer-and-theme-designer.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/EyalAlbert/comments/commentRss/129804.aspx</wfw:commentRss>
        </item>
        <item>
            <title>I was told it&amp;rsquo;s always good to start with a joke but I&amp;rsquo;m not that funny</title>
            <category>VWG</category>
            <link>http://geekswithblogs.net/EyalAlbert/archive/2009/01/04/i-was-told-itrsquos-always-good-to-start-with-a.aspx</link>
            <description>&lt;p&gt;So I will start with a game.&lt;/p&gt;
&lt;p&gt;I’ve been doing so many demos with &lt;a target="_blank" rel="Visual WebGui" href="http://www.visualwebgui.com/" title="Visual WebGui"&gt;Visual WebGui&lt;/a&gt; and application for so long and I think it’s time to do some fun and games. I will write a more specific post later on &lt;a target="_blank" rel="Visual WebGui" href="http://www.visualwebgui.com/" title="Visual WebGui"&gt;Visual WebGui&lt;/a&gt; what we do (For this post I want to believe you all ready know what it is). &lt;/p&gt;
&lt;p&gt;I really have to get this out of my system and also I don't think you can’t call a platform a platform if no one develops a game on it. So here is the first ever (as far as I know) &lt;a target="_blank" rel="Visual WebGui" href="http://www.visualwebgui.com/" title="Visual WebGui"&gt;Visual WebGui&lt;/a&gt; based Game.&lt;/p&gt;
&lt;p&gt;My very own Picture Scramble. If you don't know what is a picture scramble game the idea is very very simple and old. What you basically have a picture that was cut to a specific number of cubes and one of those cubes preferably the bottom right one is removed. Next you need to scramble the pictures and sort them back to the original picture by moving a picture to the open space that was created by removing the bottom right cube. For this example I’ve used “Chips” my cat as a model you can see the picture before I sorted it and after. Don’t let the picture fool you, he is the devil spawn.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_2.png"&gt;&lt;img height="331" width="217" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_thumb.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_12.png"&gt;&lt;img height="330" width="204" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_thumb_5.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;So I create a new VWG application template and Enabled &lt;a target="_blank" rel="Visual WebGui" href="http://www.visualwebgui.com/" title="Visual WebGui"&gt;Visual WebGui&lt;/a&gt; integration to allow access to Visual Studio’s integrated options of VWG to my project.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image4.png"&gt;&lt;img height="256" width="318" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image4_thumb.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt;      &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image9.png"&gt;&lt;img height="235" width="247" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image9_thumb.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Next I’ve added a new VWG User Control SlicedPictureBox.cs. This control will hold a slice of the source image.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image13_1.png"&gt;&lt;img height="258" width="257" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image13_thumb_1.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt;      &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image16.png"&gt;&lt;img height="222" width="303" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image16_thumb.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Make our SlicedPictureBox inherit from PictureBox and add a few members.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;PictureBox&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;    #region&lt;/span&gt; Members&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: green;"&gt;//The current image slice part&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; mobjSlicePart = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;(0, 0);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: green;"&gt;//The location of the current slice&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; mobjPicLocation = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;(0, 0);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: green;"&gt;//The size of the grid that cuts the image&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt; mobjGridSize = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt;(1, 1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: green;"&gt;//The size of source image&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt; mobjSourceSize = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt;(1, 1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: green;"&gt;//A resource handle to the image&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ResourceHandle&lt;/span&gt; mobjSource = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;    #endregion&lt;/span&gt; Members&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Next we will add properties for these members.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; SlicePart&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; mobjSlicePart; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;set&lt;/span&gt; { mobjSlicePart = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; PicLocation&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; mobjPicLocation; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;set&lt;/span&gt; { mobjPicLocation = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt; GridSize&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; mobjGridSize; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Update();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        mobjGridSize = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The last property we need to add is for the ResourceHandle Source. Resource handles are actually pointers to the actual resource. When a control requires a resource such as an Image it should declare a ResourceHandle typed property that will link to an external located resource that will be retrieved through HTTP.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ResourceHandle&lt;/span&gt; Source&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; mobjSource; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        mobjSource = &lt;span style="color: blue;"&gt;value&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;if&lt;/span&gt; (mobjSource != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt; bm = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt;(mobjSource.ToStream());&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: green;"&gt;// Calculate the Crop size&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;int&lt;/span&gt; intCropWidth = bm.Size.Width / mobjGridSize.Width;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;int&lt;/span&gt; intCropHeight = bm.Size.Height / mobjGridSize.Height;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: green;"&gt;//Set the size of the control according to Crop size&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Size = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt;(intCropWidth, intCropHeight);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Every control in VWG implements IGatewayComponent that provides a way for a component to handle requests. We will override the ProcessGatewayRequest function and set the behavior of our resources handle. What we will do is create a cropped image from the master resource according to the grid size.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;protected&lt;/span&gt; &lt;span style="color: blue;"&gt;override&lt;/span&gt; Gizmox.WebGUI.Common.Interfaces.&lt;span style="color: rgb(43, 145, 175);"&gt;IGatewayHandler&lt;/span&gt; ProcessGatewayRequest(&lt;span style="color: rgb(43, 145, 175);"&gt;HttpContext&lt;/span&gt; objHttpContext, &lt;span style="color: blue;"&gt;string&lt;/span&gt; strAction)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;if&lt;/span&gt; (mobjSource != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt; bm = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt;(mobjSource.ToStream());&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;int&lt;/span&gt; intCropWidth = bm.Size.Width / mobjGridSize.Width;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;int&lt;/span&gt; intCropHeight = bm.Size.Height / mobjGridSize.Height;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt; cropped = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Bitmap&lt;/span&gt;(intCropWidth, intCropHeight);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Graphics&lt;/span&gt; g = &lt;span style="color: rgb(43, 145, 175);"&gt;Graphics&lt;/span&gt;.FromImage(cropped);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        g.DrawImage(bm, &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Rectangle&lt;/span&gt;(0, 0, cropped.Width, cropped.Height), intCropWidth * mobjSlicePart.X, intCropHeight * mobjSlicePart.Y, cropped.Width, cropped.Height, &lt;span style="color: rgb(43, 145, 175);"&gt;GraphicsUnit&lt;/span&gt;.Pixel);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        g.Dispose();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        cropped.Save(objHttpContext.Response.OutputStream, &lt;span style="color: rgb(43, 145, 175);"&gt;ImageFormat&lt;/span&gt;.Jpeg);                &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In the control constructor we will set the Image ResourceHandle property that was inherited from the PictureBox class to a new GatewayResourceHandle.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; SlicedPictureBox()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Image = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;GatewayResourceHandle&lt;/span&gt;(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;GatewayReference&lt;/span&gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(163, 21, 21);"&gt;"picture"&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Now that we have our slice picture box control let’s start creating the application itself.    &lt;br /&gt;
Open form1 in design mode and add a panel docked to bottom and place two textboxes and a button on it. One text box will hold the number of rows and one will hold the number of columns.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image1_1.png"&gt;&lt;img height="74" width="532" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image1_thumb_1.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Next we will add a few members.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Amount of rows&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; mintRows;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//Amount of Columns&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; mintColumns;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//The currently opened space to move an image to&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; mobjOpendPoint;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//A collection of Points that represent the images location in the grid&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;&amp;gt; mobjPointList;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//A collection of images. &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt;&amp;gt; mobjSlicedPictureBoxList;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//A collection of shuffled images.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt;&amp;gt; mobjShuffledSlicedPictureBoxList;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;The first method that we will create will be FillPointList.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Fill the point collection with the necessary points&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; according to the row and columns that where set by the user.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; FillPointList()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mobjPointList = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mobjOpendPoint = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;(mintRows-1, mintColumns-1);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; x = 0; x &amp;lt; mintRows; x++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; y = 0; y &amp;lt; mintColumns; y++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!((x == y) &amp;amp;&amp;amp; (y == mintColumns-1)))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;                mobjPointList.Add(&lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt;(x, y));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;            }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;
The second method is SlicePictures.   &lt;br /&gt;
&lt;br /&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; Creates a collection of SlicedPictureBox. Each SlicedPictureBox gets a &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; point that represent the part that it needs to crop with the ProcessGatewayRequest&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; function.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; SlicePictures()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mobjSlicedPictureBoxList = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; objPoint &lt;span style="color: blue;"&gt;in&lt;/span&gt; mobjPointList)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt; objSlicedPictureBox = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.GridSize = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Size&lt;/span&gt;(mintRows, mintColumns);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.Source = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ImageResourceHandle&lt;/span&gt;(&lt;span style="color: rgb(163, 21, 21);"&gt;"Image1.jpg"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.SlicePart = objPoint;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.BorderStyle = &lt;span style="color: rgb(43, 145, 175);"&gt;BorderStyle&lt;/span&gt;.FixedSingle;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.Click += &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;EventHandler&lt;/span&gt;(objSlicedPictureBox_Click);                &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        mobjSlicedPictureBoxList.Add(objSlicedPictureBox);                &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;Open form1 in design mode and add another panel docked to fill. Rename it to MainPanel. This panel will hold the scrambled puzzle.      &lt;br /&gt;
Go back to the code section of form1 and add a new method DrowPicturees.&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;     &lt;br /&gt;
&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; clears the main panel from all the pictures and draws a new set of pictures.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; DrowPicturees()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;this&lt;/span&gt;.MainPanel.Controls.Clear();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt; objSlicedPictureBox &lt;span style="color: blue;"&gt;in&lt;/span&gt; mobjShuffledSlicedPictureBoxList)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.Left = objSlicedPictureBox.Width * objSlicedPictureBox.PicLocation.X;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.Top = objSlicedPictureBox.Height * objSlicedPictureBox.PicLocation.Y;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;this&lt;/span&gt;.MainPanel.Controls.Add(objSlicedPictureBox);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin: 0px;"&gt;     &lt;br /&gt;
&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;Last method we need to add is Shuffle.&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt;Fills the mobjShuffledSlicedPictureBoxList with images from&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt;mobjSlicedPictureBoxList but scrambles the order of the images &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: gray;"&gt;///&lt;/span&gt;&lt;span style="color: green;"&gt; &lt;/span&gt;&lt;span style="color: gray;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Shuffle()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mobjShuffledSlicedPictureBoxList = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: rgb(43, 145, 175);"&gt;Random&lt;/span&gt; randNum = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Random&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;int&lt;/span&gt; objNumberofSlice = mintColumns * mintRows-1;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; objNumberofSlice; i++)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;int&lt;/span&gt; intNext = randNum.Next(0, objNumberofSlice - i);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;SlicedPictureBox&lt;/span&gt; objSlicedPictureBox = mobjSlicedPictureBoxList[intNext];&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        mobjSlicedPictureBoxList.Remove(objSlicedPictureBox);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        &lt;span style="color: rgb(43, 145, 175);"&gt;Point&lt;/span&gt; objPoint = mobjPointList[i];&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        objSlicedPictureBox.PicLocation = objPoint;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;        mobjShuffledSlicedPictureBoxList.Add(objSlicedPictureBox);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Now let’s add an event to click of the button. On that click event we will read the rows and columns size and create the scramble puzzle.&lt;/p&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; button1_Click(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs&lt;/span&gt; e)&lt;/div&gt;
&lt;div style="background: silver none repeat scroll 0% 0%; font-size: 10pt; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: black; font-family: courier new;"&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mintRows = &lt;span style="color: blue;"&gt;int&lt;/span&gt;.Parse(objRows.Text);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    mintColumns = &lt;span style="color: blue;"&gt;int&lt;/span&gt;.Parse(objColumns.Text);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    FillPointList();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    SlicePictures();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    Shuffle();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;    DrowPicturees();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;All we need to do now is run the application and play. Enter the amount of rows and columns you want and press the shuffle button.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_16.png"&gt;&lt;img height="460" width="288" border="0" src="http://geekswithblogs.net/images/geekswithblogs_net/EyalAlbert/WindowsLiveWriter/Iwastolditsalwaysgoodtostartwithajokebut_9AF8/image_thumb_7.png" alt="image" style="display: inline;" title="image" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you want to download this code you can use this &lt;a target="_blank" href="http://www.visualwebgui.com/Community/Resources/Codes/tabid/326/articleType/ArticleView/articleId/403/VWG-Game-Picture-Scramble.aspx"&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I hope you enjoyed this post. I know I have.   &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128347"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128347" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/EyalAlbert/aggbug/128347.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Eyal Albert</dc:creator>
            <guid>http://geekswithblogs.net/EyalAlbert/archive/2009/01/04/i-was-told-itrsquos-always-good-to-start-with-a.aspx</guid>
            <pubDate>Sun, 04 Jan 2009 17:04:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/EyalAlbert/comments/128347.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/EyalAlbert/archive/2009/01/04/i-was-told-itrsquos-always-good-to-start-with-a.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/EyalAlbert/comments/commentRss/128347.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Long-time reader, first-time writer</title>
            <link>http://geekswithblogs.net/EyalAlbert/archive/2008/12/18/long-time-reader-first-time-writer.aspx</link>
            <description>&lt;p&gt;Hi all and welcome to my brand new blog.&lt;/p&gt;  &lt;p&gt;My name is Eyal Albert as you can understand from the blog’s name.&lt;/p&gt;  &lt;p&gt;I’m a 31 years old software developer from Israel.&lt;/p&gt;  &lt;p&gt;For the last couple of months I've been evangelizing Gizmox’s &lt;a title="Visual WebGui" href="http://www.visualwebgui.com/" rel="Visual WebGui" target="_blank"&gt;Visual WebGui&lt;/a&gt; platform. I’ve joined Gizmox earlier this year as a core developer.&lt;/p&gt;  &lt;p&gt;Somehow things shifted and I found myself writing most of the time “How to” and giving lecturers and web casts. &lt;/p&gt;  &lt;p&gt;This led me to think that it’s time for me to open my own blog and publish my stuff.&lt;/p&gt;  &lt;p&gt;I’m still not sure where this blog is going but I'm sure that all will be revealed as I stroll down this road.&lt;/p&gt;  &lt;p&gt;After all “All roads lead to Amber”&lt;/p&gt;  &lt;p&gt;Eyal&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128020"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=128020" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/EyalAlbert/aggbug/128020.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Eyal Albert</dc:creator>
            <guid>http://geekswithblogs.net/EyalAlbert/archive/2008/12/18/long-time-reader-first-time-writer.aspx</guid>
            <pubDate>Thu, 18 Dec 2008 14:41:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/EyalAlbert/comments/128020.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/EyalAlbert/archive/2008/12/18/long-time-reader-first-time-writer.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/EyalAlbert/comments/commentRss/128020.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>