Identify Subtriangle Within A Rectangle Given A Coordinate In That Rectangle?
Feb 22, 2010
Given a rectangle of width w and height h. and a coordinate x,y in that rectangle I would like to identify which triangle I am within.
i.e. the function should take parameters(x,y) and return a,b,c,d or a zero based number representing that triangle index i.e. (0=A,1=B,2=C,3=D) if they are in that order.
I think this would be something like >= the formula of the red line and >= the formula of the green line?
I'd like to implement this in VB.NET
View 3 Replies
ADVERTISEMENT
Jul 26, 2010
i've got a little problem with List(on T) variables.
[code]...
It works perfectly fine. Does anyone know what the problem is?
View 2 Replies
Dec 3, 2011
This code is to draw rectangle. How can I draw rectangle divided to four rectangle or more
e.Graphics.DrawRectangle(Pens.Coral, 50, 200, 30, 40)
View 11 Replies
Jul 26, 2009
I'M creating a kind of photo viewer, and I cannot figure out how to orient the scroll buttons with the photos I want to draw because they all are different sizes.This is really hard to explain so please ask questions if you don't understand.I'M thinking if i could draw every photo on a single rectangle and then the scroll bars will position that rectangle up or down. but is there a way to make a rectangle inside another one so it only shows inside that rectangle?
View 10 Replies
Apr 14, 2011
myObject.rect.X = 100
myObject has a property called rect (which is a Rectangle). During runtime I will want to chage the X position of such rectangle, but I am given this error:
Expression is a value and therefore cannot be the target of an assignment.
Then, how am I supposed to change such values?
View 1 Replies
Feb 1, 2010
It is my understanding and experience that VB.NET does not perform well with moving graphics from point A to point B in a form. How do I draw a rectangle or a line and move it from point A to point B? Is there a reliable way to do this without seeing a black rectangle around the moving object on every frame? I've tried this with bitmaps before but it doesn't work. I see the frame rendering and it's way to slow. Perhaps there is an animation Control or library?
View 3 Replies
Jul 21, 2009
How to take screen of rectangle I know how 2 take screen shot but I can't make it screen shot at coordinates 100, 100, 120,120. [cod]...
View 6 Replies
Mar 16, 2012
i want to add a new floating rectangle with an image inside it to my form when i click on a button control and then use a timer control to move it in a straight line across the Form. the problems I'm having are:
1) Drawing and filling the RectangleF on the screen.
2) Animating/moving it from X1,Y1 to X2,Y2
3) Triggering the Drawing and movement with a Button Control
View 6 Replies
Oct 15, 2010
Im having trouble with assigning a Rectangle to this constructor
fTrainAdmin = New TrainAdmin( )
View 2 Replies
Sep 4, 2010
I have a canvas in the middle of my application with controls around it. I have a socket that recieves Points and saves them in a list.
I draw small 4x4 rectangles on the canvas for the number of points in my list.. say theres 4 points.. theres 4 rectangles.
I want to be able to move the rectangles when the points change with code.
is this possible without storyboards or any 'animation' class?
I have tried:
'cMap.Children.Remove(r)
'Dim nr As Rectangle = New Rectangle() With {.Width = 4, .Height = 4, .Name = "r" & P.Name, .Fill = Brushes.Red}
[Code].....
View 2 Replies
Aug 5, 2009
i want to change the cursor style i change from properties of form but there is only limited availability want to change it like square box or rectangular. i have image when i place the picture on picture box the cursor will change to box?
View 3 Replies
Aug 8, 2010
In java, if you've ever scripted java, there is a class called "Rectangle" in which will click in the specified Rectangle. Well in a WebBrowser, is it possible to click a certain Rectangle? (Only in the webbrowser), or a certain point
So navigate, wait for DocumentLoad, then click in rectangle?
View 8 Replies
Aug 25, 2011
I am attempting to draw and fill a rectangle using percentages passed through the text properties of 4 textboxes. I am attempting to do this in VB 2008. For example:
textbox1, 15%, green
textbox2, 35%, blue
textbox3, 40%, red
textbox4, 10%, orange
View 1 Replies
May 17, 2011
is this possible to draw a red rectangle about a text box? How?
View 4 Replies
Oct 3, 2010
I have a datagridview in my application. and I have created a function for searching different words in datagridview. When the functionfind the word in one cell of datagridview, the cell is selected, but I want to draw a red rectangle in the selected cell when I found the searched value.
I have made my application in visual basic.
View 6 Replies
Oct 5, 2009
I am trying to draw a rectangle in a PictureBox (100 x 50)
Using gr As System.Drawing.Graphics = Picbox.CreateGraphics
Dim rect As New System.Drawing.Rectangle(10, 10, 80, 30)
gr.DrawRectangle(Drawing.Pens.Blue, rect)
End Using
From looking at the examples in my book, I "think" it should work, but alas, tis not working - nothing is drawn.
View 1 Replies
Apr 29, 2009
Public Class Form1
Private opsets As New List(Of OpSet)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
opsets.Add(New OpSet(Me, 100, 300))
[code]....
View 1 Replies
Mar 12, 2011
User launches the application, enters width of circle, then enters width and height of rectangle and presses the button. Then app draws the circle with rectangle inside of it (if it fits). App should output the coordinates x1;y1 , x1;y2 , x2;y1 , x2;y2 (corners of rectangle) somewhere on form and would be great if it could post those coordinates on x and y axes (optional).
View 23 Replies
Oct 30, 2011
How can i draw a rectangle in picturebox using coordinate(X , Y) and size of rectangle from textbox?
View 7 Replies
Jun 6, 2011
Draw rectangle outside of form?[url]...
View 1 Replies
Apr 24, 2010
I have used this code to draw an rectangle around the panel
vb
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.PaintWith Panel1 e.Graphics.DrawRectangle(Pens.Gray, .Left - 1, .Top - 1, .Width + 1, .Height + 1) End WithEnd Sub
but when the form is resized the rectangle isnt drawn properly.The panel has Left,R,T,B anchor.
View 10 Replies
May 2, 2011
I have this code where I'm wanting to draw text inside a defined rectangle and if it's too wide I want it to be slit onto multiple lines and if it's too tall, I was it to only paint what it can which right now it's not cutting it off it continues on below the bottom border.Here's my
Dim NotesRect As New RectangleF(mMargins.Left + LeftIndent, m_PagePositionSingle, mMargins.Right, mMargins.Bottom)
e.Graphics.DrawString(NotesString, m_ItemFont, Brushes.Black, NotesRect, New
[code].....
View 9 Replies
Feb 16, 2011
Working on some UI stuff, but I am having a problem drawing 'Top rounded' rectangles when the two top corners are rounded. I have methods to draw all four corners rounded and bottom rounded rectangles and they render fine.
I have attempted the graphics methods in CreateTopRoundedRect() in a variety of different orders, drawing the other corner first, the bottom line first, the bottom line before the left line, etc. In this function you can see a diagonal line splitting the shape. If you were to switch the bottom and left lines only half of the shape would be filled.
[Code]...
View 3 Replies
Sep 28, 2009
i've found this code on the web that allow me to draw a rectangle and keep the Image inside this. But there is a way to make draw this rectangle in all the direction and not only from left to right and top to bottom?
Public Class frmSS
Private Declare Auto Function BitBlt Lib "gdi32.dll" ( _
ByVal hdcDest As IntPtr, _
[code]......
View 4 Replies
May 14, 2011
I am raw hand. I want a simple function, when I press a button, I change a Rectangle position and size. so the code is:
[Code]...
View 10 Replies
Jul 10, 2009
I am doing windows application in vb.net, now I want to move the rectangle using key event.
View 12 Replies
Feb 20, 2011
I have been programming for about 1 year now... and I'm only 14 but currently I'm making a game in visual basic.In this game on I want a Label which looks like a rectangle to flash.
so
Private Sub Start_Click
gamestart = True
Timer1.Enabled = True
Timer2.Enabled = True
Start.Visible = False
Next1.Visible = True
End Sub
timer1 is the stopwatch.and i want timer2 to make the label which looks like a rectangle to appear every 5 seconds..
View 2 Replies
Jun 25, 2009
How can I temporarily disable listview selection rectangle, so when someone clicks the listview and holds the button down & moves the mouse, the rectangle is not shown? And how do I enable it again after that? (VB.NET)
View 1 Replies
Apr 26, 2011
If I drew a rectangle using e.Graphics.FillRectangle() is there a way I could punch transparent holes in it?
View 16 Replies
Sep 15, 2011
Is there an easier way to round the corners of a rectangle than the following method. The corners are a bit rough in the following.
Run this example to see
Public Class Form10
Dim I%, J%, K%, S$
Dim btmp(1) As Bitmap
[Code].....
View 2 Replies