Skip to main content

How to Draw Home Design in C#

Source: How to Draw Home Design in C#

In this post I am going to put the code about how to design home architecture in C#. Using C#, you can do anything with simple codebase. Suppose you are an architecture or civil engineer and you need a software where you can put the size of each bedroom, drawing room, toilet, store room, kitchen, balcony, exit gate &  entrance gate details and you will get a full architecture of your home. I have built a simple architecture using C#. All fields are dynamic that can be change anytime. You can also print those architecture image. The image will look like this:

I used a simple rectangle method to build these architecture. 
  • Create a database in ms-access.
  • Store all information like width and length of bedroom, drawing room, toilet, store room, kitchen, balcony, exit gate &  entrance gate.
  • Get each room length and width and build a structure using C#
  • Now draw some architecture:
                     if (flat_type=="1BHK")
                        {
                            DrawRectangle(50, 50, exg_w, exg_h, "Entrance Gate");
                            DrawRectangle(50, 50, dr_bdh, dr_len, "Drawing Room");
                            --
                            --
                        }
                        else if (flat_type == "2BHK")
                        {
                            DrawRectangle(50, 50, r1_bdh, r1_len, "Bedroom");
                            DrawRectangle(50 + r1_bdh - exg_h - 10, 50 + r1_len, exg_h, exg_w, "gate");
                            --
                        }
                        else if (flat_type == "3BHK")
                        {
                            DrawRectangle(50, 50, r1_bdh, r1_len, "Bedroom");
                            DrawRectangle(50 + r1_bdh - exg_h - 10, 50 + r1_len, exg_h, exg_w, "gate");
                            --
                        }
For Printing we use this function:
private void PrintScreen()
        {
            Graphics mygraphics = this.CreateGraphics();
            Size s = this.Size;
            memoryImage = new Bitmap(s.Width, s.Height, mygraphics);
            Graphics memoryGraphics = Graphics.FromImage(memoryImage);
            IntPtr dc1 = mygraphics.GetHdc();
            IntPtr dc2 = memoryGraphics.GetHdc();
            BitBlt(dc2, 0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height-50, dc1, 0, 0, 13369376);
            mygraphics.ReleaseHdc(dc1);
            memoryGraphics.ReleaseHdc(dc2);
        }

Full code is available on request at esoftcode@gmail.com

Comments

Popular posts from this blog

Beware! Access blocked URL's in India get 3 years in jail and penalty of 3 lakhs

Reference Link:  http://www.esoftcode.com/Blog_Details.Aspx?Blogid=17 Visiting blocked sites and URL's were fine until now. There are many ways to access blocked URL's. You can use some proxy servers to access those sites. But now you should not. Indian government has banned thousands of websites and URL's in the country with the help of nternet service providers (ISP) or under the directive of the courts. In August 2015, the government banned at least 857 sites for their pornographic contents. Moreover, the government also banned about 170 objectional sites. As per report, if you try to visit these sites and view information, you could get a 3-year jail sentence and be fine a sum of Rs. 3,00,000/-  too. This penalty is just for viewing a torrent file or downloading a file from a host that is banned in India. It is not necessary for users to download a torrent file such as videos, but just visiting the sites and viewing the information is enough to...

Downfall of quality of work in software development

When we see Software development field and their work culture, get excited about this. However, no one knows how the software industries work. In these days, there are plenty of software development companies, entrepreneur, in the form of freelancers, small companies, and giant companies in every city of the world. All are having different client base and dealing in their own way. I found very interesting and at the same time dangerous about downfall of quality of work in software development. I found following reason about downfall of quality of work: Too Much Price Negotiation Unskilled Freelancers or Unskilled Team Internship for Making Profits Too Much Price Negotiation As per my experience, I found out that price negotiation in every business is happening and it is worth it. Too much price negotiation is not worth it. Suppose if a website development actual cost is $500 and you want it in $100, it is not possible in any way. However, in these days you will get the ...