Algo / Code To Cover A Rectangular Area Using Circles?

Jun 13, 2012

This is a problem like the puzzle - "find minimum number of coins to completely cover a piece of paper".

The difference is:

in my case RADIUS of the coins is variable (but all coins should have same radius).

Real scenario:

1. I need to draw circular shapes on a rectangular image.

2. Number of circles (N) is CONSTANT/ User input

3. Size of image (S) is CONSTANT/ User input

4. The program should find the MINIMUM RADIUS (R) that is needed to draw N number of circles on an image of size S, so that, the image is completely hidden behind the circles.

This is NOT a puzzle/assignment that I'm trying to solve.This is part of a larger project that I'm working on.

I don't need any drawing code. I just need the code/algo to find the radius.

View 22 Replies


ADVERTISEMENT

Take A Screenshot Of The Rectangular Area?

Jun 15, 2009

I'm currently using the following code to take a screenshot of my desktop:

Dim r As Rectangle = Screen.PrimaryScreen.WorkingArea
Dim bmp As New Bitmap(r.Width, r.Height)
Dim g As Graphics = Graphics.FromImage(bmp)

[code].....

I'd like some direction in taking a screenshot of just a specific area. The area I need is where the rectangle encapsulates. If 've played around with it for a while tyring to figure out how to just take a screenshot of the rectangular area, but can't seem to figure it out.

View 2 Replies

Check For Object Location Around Rectangular Area?

Oct 12, 2011

I have a form that allows me to drag and drop pictures but I want it to check if the object is in the correct location

*curpic = the current picture that has been selected
If curpic.location.X > bx1.Location.X And curpic.location.Y > bx1.Location.Y Then
If curpic.location.X < bx1.Location.X + bx1.Width And curpic.location.Y < bx1.Location.Y +

[code].....

View 2 Replies

.net 08 Local Area Network (LAN) Source Code?

Mar 4, 2010

find a source code of using a local area network(LAN) in visual basic.net 2008?

View 1 Replies

Cannot Change The Value Of Text Area Using Code Behind File?

Feb 16, 2011

I want a multi line textarea using VB.net.I have used textarea in html before but I have never used it in VB.net I tried:

<text area id="TA" cols="100" rows="20"></textarea>

I introduced space between text area only coz I cud not write it other wise in this forum.. in my code there is no space. But I cannot change the value of textare using my code behind file.

View 1 Replies

Code - Make A Simple Area Calcutor

May 22, 2011

I am not a computer programmer and I have never used Visual Basic before but I have to take a class about using it. I am trying to make a simple Area calcutor but what it is telling me in my book to do isn't working.

View 1 Replies

Form Shows Code Not Design Area?

Jul 31, 2009

Something happened to my project and it got all messed up. I am not sure what happened, but the form I was working on only shows the code and not the project itself(where you design it). I am working in VB2008 Express Edition and do not wish to start over. What happened to my form?

View 6 Replies

Set The Viewable Area To A Smaller Screen Area?

Jun 11, 2012

Trying to set the viewable area to a smaller screen area and have it cycle through as the person moves using collision detection to move the backgroudn image. Here is the start but its off to a bad start so far.

Public Class Form1
Dim Mapx As Integer = 600
Dim Mapy As Integer = 2000

[code]....

Basically the forum size is set to 600x2000 but the client should only allow you to view 600x600. I want it to add +1 once you "collide with a invisable box I'll add and this will redraw the screen.

View 4 Replies

Specify Actual Usable Form Area Instead Of Outside Area?

May 12, 2010

I designed a form and managed to fit graphics inside it. Picture box is 465 pixels high. Form1 is 500 pixels high. SnapShot of the screen verifies that the 500 pixel height is the overal height. It includes the upper Bar and lower frame. Is there an instruction to set the From's inner pixel size and not overal?

View 2 Replies

Drawing Circles In .NET?

Mar 22, 2010

However my m8 will support me with any problems about the server, but he doesn't know how to fix this one in the client.The Sub have to create random sized circles, which are showed when u just hit some **** in space.It works fine in VB6, but in .NET i got a lot of ISSUES:

Sub DrawHitCircles(ByRef accuracy As Short)
Dim GO As Single
Dim check As Short
Dim guns As Short

[code]....

View 5 Replies

50 Random Circles With Different Colors?

Feb 9, 2011

I am working on a program to generate 50 circles starting with the smallest in the center of the form. The circles do not over lap and the appear to grow outward. Each circle has to be a random color. I have the code that generates what I need but all the circles are the same color. I was thinking about either using an array to hold each circle and color as to not assign the same color to all of them but not sure about putting a graphic in an array. I also think maybe a nested loop of some sort but was unable to figure one out.

Private Sub mainForm_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Click
Dim penColor As New Pen(Color.FromArgb(Rnd() * 255, Rnd() * 255, Rnd() * 255, Rnd() * 255), 2)

[Code]......

This works to do what I need to get done, I just need each circle to have a random color as it is drawn.

View 2 Replies

Moving Circles Within A Form?

Aug 5, 2009

The purpose of this (maybe there is a better method I don't know) is to so the user can say what order they want pieces of code to be compiled in. Sort of like a flow-chart. I want it somewhat animated, so, example being 3D circles the user drags and drops in the order they want things.

1. I need 4 circles inside of a form.

2. I need it so when the user selects the circle, they can drag and drop it in an order.

3. User clicks OK to finish their chosen order.

I haven't designed anything before that needed to check the borders of the form etc.

View 1 Replies

VS 2008 Drawing Circles At Run Time?

Jul 5, 2010

I've got a fun little question for you all. I am designing a program that allows you to click on a picture to input data in certain areas. What I want to do it pretty allow someone to take a look at a picture. Click the add point tool, then select an area on the picture where it places a circle. I then want them to be able to go back to the circle and modify data if necessary

View 8 Replies

Interface And Graphics - Randomly Generating Circles

Mar 1, 2009

I am trying to randomly generate circles at the top of the screen, but it doesn't seem to be working. I want it to generate five balls, but it only generates one, and it's in the same place each time. [Code]

View 5 Replies

Make Collide A Lot Of Circles Drawn During Runtime?

Jul 14, 2009

Right now I'm trying to make collide a lot of circles drawn during runtime. I have no problem making 1 circle collide with the form's bounds nor with another circle, however, if I draw like 25 circles in runtime, how can I make each one "move" and set the "collision properties"?

Can I make the circles move outside of the form? Let's say, the whole screen?

View 15 Replies

VS 2005 Logic For Filling Circles In A Rectangle?

Nov 14, 2010

I am struggling with coding up a bit of logic.

I have a map which I have created zones which are basically rectangles which have the coordinates sorted

eg
Zone 1
Zone 2
Zone 3

I then want to create circles within the rectangles. So for example

Item1, Zone1
Item2, Zone1
Item3, Zone3
Item4, Zone2
Item5, Zone1

So i would like Item 1, 2 and 5 to show up as three circles and when the mouse cursor floats over them to show it. The item list is dynamic and so I am not sure how to get about with this?

View 7 Replies

VS 2010 Drawing Circles In A Chart Temporarily

Jan 13, 2011

Im drawing a chart based on values from a database as an image in a picturebox. I can then add lines and circles etc in the picturebox, so as to highlight areas in the chart.

The next step I would like to do is to have temporary lines and circles, so when I move the mouse, the circle grows or shrinks and only when I release the mousebutton the circle is assigned to the chart picturebox.

View 1 Replies

Draw Ishihara-transformations (circles In Circle Without Intersection)?

Apr 28, 2011

Question: I need to draw pictures as below in C#/VB.NET Draw ishihara-transformations (circles in circle without intersection)?

Note that my problem is NOT drawing circles in C#.

My problems is drawing them without much whitespace and without intersection.

My thought would be using "Orbits" and then draw the circles with center on the "orbit" lines. (with some orbit lines for bigger and some only for smaller circles)

View 2 Replies

VS 2010 Drawing Circles, Rectangles, Elongated Shapes?

Apr 20, 2012

I would like to draw a rectangle on a form, for example to mimic a steel beam that is 6 metres long.Within this rectangle, there may be 4 "openings" or circles that mimic a diameter of 600mm, so i need to draw 4 circles within the rectangle, to indicate a beam that has 4 openings. Other issues I need to cater for is that one of the circles may not be in the centre, it may be slightly raised.The user can change the length of the beam and the size of the openings so i'd like to refresh my drawing to keep in line with this.

View 3 Replies

VS 2008 Cover Art Download?

Sep 2, 2009

Was wondering if anyone had an example of where / how i can download cover art based on artist / song name. I used to download an xml file from amazon ... but this is no longer supported by them

View 1 Replies

VS 2008 Get Cover Of Mp3 Files?

Feb 3, 2012

how i get just cover(no tags) picture of a mp3 file in vb.net?

View 1 Replies

Making A Non-rectangular UI

Apr 15, 2009

I'm making a non-rectangular UI and I've tried different approaches but still can't get the results I want. The following codes are for the user to move the form around.

[Code]....

View 10 Replies

Cant Get Faxdoc To Send A Cover Page?

Feb 2, 2010

I cant not get my faxdoc to send a cover page? I can not figure this out. Please help!!!

I have tried.FaxDocumentObj.CoverPageType = FAX_COVERPAGE_TYPE_ENUM.fcptSERVER

FaxDocumentObj.CoverPage ="C:Documents and SettingsabbyDesktopFax Coversgeneric.cov"
and this FaxDocumentObj.CoverPageType = FAX_COVERPAGE_TYPE_ENUM.fcptLocal
FaxDocumentObj.CoverPage =
"C:Documents and SettingsabbyDesktopFax Coversgeneric.cov"

Is there a way of setting the local path if I use Type Local? Can a cover page be something other than .cov? I was hoping to use .rtf. The only thing that will allow me to send is None and I don't get a fax cover page..

View 8 Replies

Create Picture Cover For MP3 - MP4 - AVI And 3GP File

Feb 16, 2012

Any body who have an experiences of have make the song player with picture cover for file extension like .mp3, .mp4, .avi, and .3gp. This will to complete my song search tiny project. I've been tryed to read any thread but not enough information and some turtorials source code got an error code and file references. First of all we clicking on Add Song button and then we choose the song file like .mp3, .mp4, .avi, or 3gp After insert the song files already. Next we go to clicking on Add Image button to choose the favorite image so the image will be shown on Picturebox the last we click on Save done.

[Code]...

View 1 Replies

Unable To Download Album Cover

Jun 11, 2009

I've made some changes to code in order to add rows to a database and now am unable to download the cover image from Amazon.

Here's the code:

Try
'---get the book cover image as a byte array---
Dim ms As New System.IO.MemoryStream()
picCover.Image.Save(ms, picCover.Image.RawFormat)

[code]....

View 2 Replies

Display A Rectangular Array?

Aug 2, 2011

I'm trying to do a tic-tac-toe console application for practice. I created a case statement for the user to pick which square they want to fill in. [code]...

View 1 Replies

Draw Rectangular Outside The Form?

Oct 21, 2010

I would like to draw a rectangular outside the form using mouse position but so far, I only found out how to draw rectangular inside the form.

View 12 Replies

VS 2010 Rectangular Array?

Dec 9, 2010

In a rectangular array which is correct or considered standard? dim array(row,column) as..or dim array(column,row) as. Not sure it actually matters outside of how it looks in your head.

View 4 Replies

Fitting A Form To Cover The Entire Screen

Sep 11, 2011

I have a program and wish to generalise its appearance at startup on different machines. This worked OK until I moved it onto a Windows 7 unit with a 22" screen. The front page covers less than 2/3 of the screen. I know I've asked the system for 'working area' but could not find a reference to the entire screen which other applications seem able to use. How can I catch up with them? The code is from VB in VS2005. Is this my limitation?

[Code]...

View 4 Replies

Forms :: Cover Whole Screen Including The Taskbar?

Nov 18, 2011

I want to make a form fullscreen and cover including the taskbar. Can anyone help me with this?

[XCODE]
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.WindowState = FormWindowState.Maximized
Me.TopMost = True
End Sub
[/XCODE]

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved