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

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 ...

Why should one build his own server?

Having your own web server is more expensive than the cheap web hosting options. But here is the benefits why would you choose to run your own web server: What happens if one of the websites get hacked on the shared server? This probably wont be your fault but all it takes is one site to be exposed and the entire web server can be hacked and yes your site too. So, better option is to host your own server. How your custom email goes into peoples junk mail folders? This will be because your web server is blacklisted. You can solve it easily if you have own server. It offers a good learning to understand server setup and configuration. You have full control, you know every bit of hardware and software that has gone into it. When you need to reset the server or install anything you don’t need to contact tech support and wait for a response, you can simply pull the plug yourself. You will never get hacked because of another persons insecure website running on the same server. You ...

How to block unwanted emails in Gmail ?

Source:http://www.esoftcode.com/Blog_Details.Aspx?Blogid=30095&Blog=How+to+block+unwanted+emails+in+Gmail There are lots of email you received is not related to your requirements i.e. most annoying things about the internet. And it's just email spam that's fill up your inbox. You get emails from every website where you are registered. And there are many spammers who got your email id and send marketing emails on daily basis. You can not check each of spam emails that is not relevant to you. Now, Gmail makes it easy to block emails from addresses you're not interested in. How to Block Unwanted Emails in Gmail Login to your Gmail account. Find an email from the person, business, or random address that you want to block. Open the email. Click on the down arrow on the same line as the sender's name/address. Select Block "[Sender's name/address]". How to Unblock Emails in Gmail If you accidentally block the wrong person's, don't...