In my application I need to draw several filled rectangles on a panel with a tiled background image. Depending on user actions, certain - not all - rectangles must be removed afterwards, revealing the background image again. Drawing and filling the rectangles is not so difficult, but how can I remove them in such a way that the background gets restored correctly?
I want to write a vb program to allow user to draw rectangle. User can click on a point as starting position and drag on the screen. A rectangle is drawn with the current mouse position and the starting position. The user then release the mouse as end position. When the rectangle is drawn, user can resize the rectangle by drag the border of the rectangle.
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'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?
I am using query from a SQLite database as the AutocompleteCustomSource for a ComboBox. Also, I want to load data in separate thread. My LoadData method works fine when called directly, but it fails when it is called from the BackgroundWorker thread. When it is called from the background thread, it throws a Specified cast is not valid exception on the csearch.AutoCompleteCustomSource.Add(hh("Taj")) line. Below is my code:
Sub LoadData() Dim connetionString As String Dim cnn As SQLiteConnection
I draw some graphics on a picture box. However, I want to change the width and height of the picture box so that the drawn graphics fit exactly in the picture box (during run time, where graphics may change). How can I do this, or how can I get the region of the drawn graphics so that I can change the width and the height of the picture box manually.
I have this code for drawing a path. Dim map As New Bitmap(l1.Size.Width, l1.Size.Height, l1.CreateGraphics) Dim nextPoint As Point Using g As Drawing.Graphics = Graphics.FromImage(map) Dim dPath As New Drawing2D.GraphicsPath For i As Integer = 0 To path.Count - 1 [Code] .....
l1 is a Label. When I call this it draws the path fine, but when I call it again it draws another path but doesn't get rid of the first path. Basically, I only want one path on the Label at a time.
When I populate a combobox with items that have a line and text drawn in the DrawItem event, only the line image for the first item in the list appears in the drop down portion of the combobox. The other items (index>0) shown in the drop down portion of the combobox do not contain an image of the line, yet each item in the list does contain the designated text. The correct line image does appear when the user selects an item and the drop down portion of the combobox is not visible. How can I get the line image to appear in every item of the combobox when the drop down list is activated?
Public Class Form1 Friend WithEvents ComboBox1 As ComboBox Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Me.ComboBox1 = New ComboBox With Me.ComboBox1 [Code] .....
I dont no if this if possible but im trying to set a tooltip on a ellipse that is drawn at run time on the system. I am able to attach the tooltip to a texbox etc but cannot attach it to the graphic.
I am drawing lines on a picturebox - not in the paint event. I realise that if I resize the PictureBox the lines won't be redrawn - but the PictureBox is fixed. If I display a MessageBox at the end of my draws the lines do not remain on the screen. This was OK with VB 6.0. Hoe can I stop them being erased?
I am just starting to learn this programming. But of this is very challenging. The question is:Explain what the code in the GuessLetter procedure you added does.Add your answer as a flowchart drawn at the end of your answer document. You can use the Word Draw tools to draw the flowchart. HINT: Your flowchart should have four decision points. Here is the code for Hang Man.
I have a radar which works by drawing monsters onto a paint panel, which can be made transparent so that only the drawn items are shown on screen, but when you mouse over the drawn items they are selectable so it disturbs the game, is there any way to set the drawn items so that they cannot be selected? basically ignored by the mouse cursor.
I'm creating a custom form that is composed of a inner stroke, outer stroke, and rounded rectangular background. When the form is initially drawn its drawn fine without errors but once i re size it, the old form is still drawn and the new form is drawn below it but once i minimize the form and restore it, it goes back to normal (only the new form is being drawn).
I created a form with a PictureBox. I created a drawing in the PictureBox. But I can't save the file to a specified folder without dialogue controls. Only through code.
I have a program where I use a picture box (pAudiogram) to display a template. Then I use Graphics (myLine) to plot things on this picture box. Some example code is below:
Dim myBluePen As New Pen(Color.Blue) : myBluePen.Width = 2 Dim myRedPen As New Pen(Color.Red) : myRedPen.Width = 2 Dim myLine As Graphics = pAudiogram.CreateGraphics
I want to draw lines (paths) for AI to follow. I need to know the X,Y coordinates of each pixel in the line.Lines drawn straight vertical (0 or 180 Degs), diagonal (45 or 225 Degs), or horizontal (90 or 270 Degs) are easy to map.I need to know how to map straight lines that are not one of the those three. Like 1 degree to 44 degrees, 46 degrees to 89 degrees, and so on...
I have an application that dynamically draws a chart onto a winform.Both the chart background and the individual chart bars are drawn using a VisualStyleRenderer object: For Each rect As Rectangle In barRectangles
Dim renderer As New VisualStyleRenderer (VisualStyleElement.StartPanel.UserPane.Normal) renderer.DrawBackground(e.Graphics, rect) next
this draws a nicely rendered rectangle with full XP visual styles, my question is: how do I change the colours used to draw the shape?
I'm creating a type of drawing program. The user can draw a line, much like in word or paint, etc. But once the line is drawn (to a picturebox or bitmap in memory), I want the user to be able to click on the line and drag it around (translate it).
If I know the coordinates of the endpoints of the line, as well as the pen width it was drawn with, how can I tell if a certain coordinate (mouse location) is contained by the line?
My first thought was to take a mathematical approach, like get an equation for a line, and check to see if the coordinate belonged to it. But for a higher pen width, the line is thicker, and thus contains more points.
How can I tell what coordinates are part of the line? Is there some sort of intersect function in the gdi that takes a line?
I have an VB.net application in which I have imported the MSchart control 6.0. It draws all the bars in the same colour. I want to have each bar in different colour. I want bars of the same series to be so. There is only one series of data.