Interface And Graphics :: Line Gets Smaller While Being Rotated?
Dec 17, 2010
I'm trying to rotate a mirror, which I represented by a line across a specific point. I translated the point of rotation to the center, rotated by an angle indicated in a text box and then translated it back to its original position.
Here is my code :
Quote:
HTML Code:
Dim theta As Single
Private Cntr_X_blu_Mirror As Single = 5
[Code].....
I hope the code is good. The problem I encountered is that the line becomes smaller and smaller as I rotate it. and that's bad! Sometimes it even grows longer [I think when I rotate it in the oposite direction!]
Also, when I rotate it at 90 degrees, the rotation does not resembles a 90 degree rotation. It seems to be inclined at 45 degrees instead!
View 7 Replies
ADVERTISEMENT
Sep 1, 2010
my interface is like this, i've put 4 text boxes above, followed by a Generate Button in the middle and a multiline text box below the Generate button (please see the attachment)
so all i want is when i click the Generate Button, i want the data entered inside the above 4 text boxes to display in the multiline text box at the bottom in 4 seperate lines and not in 1 row. Also i would like to have some line spaces.
this is the code i used
Code:
' This is used to display in Bold
OutputTextBox.Text = "" & TextBox1.Text & ""
' This is used to display TextBox2.Text
[Code]....
Just wondering, is it possible to put some tabs above the big multiline text box at the bottom, say like 4 tabs and each tab consists of a big multiline text box inside it. And then when clicked the Generate Button which displays different data ...
View 19 Replies
Jul 29, 2009
In a application i'm working on i need to be able to select a graphic (a line to be specific) and then i need to change or move it but i cant find how to add a click event to the line when a draw it. Basicly i want to click on the line to select it (make it fatter or an other color) and then be able to alter it in position and size (lenght). Is there any way or what is the correct way to do this?
View 6 Replies
Feb 16, 2009
insert images in a combobox. I understood the code, but what I'm asking is how do I add multiple images per line of the combobox?? I mean the way, the smileys are displayed in dropdown grid in Yahoo! messenger or the sort when you click on the smiley button..
I'm using Microsoft Visual Basic 2008 Express Edition with .NET Framework 3.5
View 1 Replies
Apr 13, 2009
I would like to build a line chart which can redraw or change during a period of time with dynamic data. So that the x, y axis will change if out of range. The graph may be somehow similar to Matlab. I am using vs2005.
View 2 Replies
Apr 8, 2012
I look at hundreds of VB.Net user interfaces through the internet and they all look horribly unsophisticated from a graphics point-of-view.Compare this to the backgrounds seen on tv broadcast that use blurred line gradients to create graphics that have some interesting appeal and draw the eye to them (at least my eye).I've attached some sample screenshot grabs below that I have annotated with magenta rects showing the interesting sections.What types of graphics routines can produce these types of graphic effects? The options that I have identified so far:
1.) More carefully done line smearing (see below..)
2.) Line drawing with a VB.Net version of the "Bresenham's line drawing algorithm"(as passel mentions in this post) (that might allow a specialized set anti-aliasing routines - like a wu algorithm).
3.) Line drawing with some Gaussian blurring as seen in the attachment to this post from my Perlin Noise thread.
4.) Possibly a gradient shaped by a vector GraphicsPath?
5.) Some other VB.Net gradient generating method?Possible the use of multiple passes with an alphafade brush?
6.) Last resort: manipulating the colors of individual pixels with lockbits marshal copying (highly undesirable).
I've done a fairly complete survey of whats out there on the internet for VB.Net samples for drawing lines to see if any of them combined line drawing with gradient effects and found very little.I played around with some code I found that did line drawing through mouse dragging and managed to achieve what I call the "line smearing" effect.I've attached my Line_Smearing_Demo below..As yet I have been unable to combine lines with shaped bezier curves,to produce Guilloche/Lissajous/complex Spirograph patterns like those seen on this page.
View 19 Replies
Jun 1, 2010
I know that you can pass a Point array to the DrawImage method of the Graphics object to apply rotation, skewing and flipping, but I'm having trouble figuring out how to calculate the rotation. So far I've got:
Dim radius As Integer = Math.Sqrt((rect.Width / 2) ^ 2 + (rect.Height / 2) ^ 2)
Dim dX As Integer = RadToDeg(Math.Cos(DegToRad(angle))) * radius
Dim dY As Integer = RadToDeg(Math.Tan(DegToRad(angle))) * dX
Dim new_upper_left_corner As New Point(rect.X + (rect.Width 2) - dX, rect.Y + (rect.Height 2) - dY)
This is all just off the top of my head so far, I'm not sure if it's right. How do I calculate the other points on the rectangle, and is there a built-in VB.NET method that's much easier? (Apart from Graphics.RotateTransform, which is slow and also rotates around 0,0.)
View 3 Replies
Apr 13, 2012
Problem drawing dotted path lines, with even dots along the path line.I want to draw a path line that can be any shape (square, round, outline etc), and along this path line I want even dots to appear.
I also want to be able to resize the shape (as in the example attached)This is very easy to do using "DrawPath" and defining points for the path and using a pen defined as dots.The problem I have is I want the dots to be evenly placed along the path, on any shape or size I draw.In the example I have created, I create a square with 4 points and draw a dotted path.There are 2 buttons that allows me to resize the square (larger or smaller) this helps show the problem more clearly.
The path starts at the top left corner and finishes back at the top left corner, the dots are evenly placed along the path, except the final dots at the end of the path. (Sometimes the dots are even and other times they are not even).The shapes I want to draw can be any size and any shape, but I have used a square in this example to show the problem I have. point me in the direction I need to go that allows me to draw the dots and give the impression that they are even all along the path, for all shapes and sizes.
In the pictures below if you change the size of the shape, one will have even looking dots, the other will not.
[Code]...
View 2 Replies
Nov 19, 2010
Im working on a project that needs to print a report of one client.Everything went smooth untill i came across my multiline input text data.When i display it in the PrintPagePreview the text go's outside my page. Even when im printing it only the halve of my text is displayed. I googled and looked everywhere but i can't get a clear fix for it.
[Code]...
View 3 Replies
Jan 22, 2011
I used to program with Visual Basic 6, so I have alot of old programs that I'm updating, plus I'm learning the new VB2008 methods. I'm writing a program that replaces the old "BitBlit" function which is no longer supported by Visual Basic 2008. It involves three picture boxes, one holds the sprite bitmap, a second holds the mask (silhouette) of the sprite bitmap, and a third has a background image.
[Code]...
View 3 Replies
Aug 14, 2009
drawing text on a window which is not the current form's window.I remember doing this in Win32 api with getwindowdc(handle) to obtain a DC for the Window, then textout() on the DC.
View 2 Replies
Jan 12, 2010
how to create a user interface in a game such as the application XFire using Visual Basic?
View 3 Replies
Oct 19, 2008
I'm working on a design project where I have to use a Graphical User Interface that contains a drag and drop form. It consists of having a window dropped on a wall. Both of them are images to scale. I would like to know what kind of code I would have to use to show the x and y coordinates of one of the points of my window when dragged so when I drop it, I'm dropping in it on the desired coordinate of the wall.
View 2 Replies
Jan 12, 2011
Ok, I want to create a class that will handle a special rectangle graphic.In my form, I want to have two of these special rectangles. So, basically, I need two instances of that class in my form, right?I manage to initialize two, alright. But, how exactly am I supposed tomanage drawing/graphics etc in a class, and the results to be displayed in my form?
View 13 Replies
Oct 29, 2008
Using graphics paths for designing...but am getting an error when trying to add a shape to : _shapelist.add(createshape())
It says : Value of type 'system.drawing.drawing2d.graphicspath' cannot be converted to '1-dimensional array of system.drawing.drawing2d.graphicspath'
View 2 Replies
May 18, 2012
I was wondering if I could elicit some tips on how to procede with an interface design approach.That is. What is a good way to go about establishing a "work area" where one can have multiple "floating forms" in this area.Can you have a form which occupies the entire windows desk top and the other forms "float" in this space? the "floating" forms would need to interact with each other where pressing buttons etc on them would affect other forms on the "workspace") Or what would be a good way to start accomplishing that? Or is there a better way to get the same effect?
View 4 Replies
Apr 21, 2010
I'm trying to make a .dll that contains a lot of basic functionality that a program can use. Currently i am trying to use interfaces to make a lot of this functionallity independend of the program using it but i hit a snag. The Basic idea is that a programmer will create his own object using the interface discribed in my .DLL file. Then implements those functions as he likes. He can then instanciate a controller (found in the same DLL) and sends his custom object implementing the interface to that Controller. The controller can then be started and will take over all the work. I do not know what type of object is send to the controller and idealy i want to program it in such a fashion that i shouldn't care as long as the object send implements that interface.In code I am trying to achieve the following: (quite simplyfied)
.Dll:
Code:
Public Interface MyInterface '<----Decleration of the interfaceFunction GetData() As Integer
Function SetData(Data As Integer)
end interface
[code]....
this propperly. I know that the second i set the interface adaptor in the Controller VS comes nagging that it can not be converted to a "MyInterface" Class. Obviously i am doing something wrong. I can change the datatype that the controller expects to the "MyController" type but that would completely ruin the whole idea of flexibillity. I am hoping someone sees what i am trying to do and can point out where i made the thinking error.
View 6 Replies
May 21, 2012
Is this where i would post a picture of my interface and get feedback on changes for easier use? If not is there someplace on this forum or any other forum to do this?
View 1 Replies
Jan 19, 2011
So I decided to make my famous tile selector project, but instead of drawing in a form's graphics, do it inside a tabpage.Well, I managed to get it working, but it seems to... flicker.Normally, setting the form's DoubleBuffered property to True would help a lot there, but apparently, the tabpage has no such property.
When I invalidate the tabpage, I draw two images and fill one rectangle.Following past advice, those two images were created before, just once, and are stored in a variable so I don't create them every time I invalidate the tabpage.
View 1 Replies
Aug 1, 2010
Ok I have this: This makes a sub called 'graphicspaint' then writes "demo version" to a picturebox1
Code:
Imports System.Drawing
Imports System.Windows.Forms
[code]......
View 8 Replies
Dec 5, 2011
i whant do my own shadow effect. i can do the shandow. but how can i plus 2 bitmap images(1 above the other)?
View 15 Replies
Oct 28, 2011
I load my picturebox with a jpeg. If I put my DrawObjects() sub into picturebox paint event.When ever a picturebox.refresh or picturebox.visible = true (vb.net seems to draw my DrawObjects() first, then load the jpeg Image over my drawing - erasing drawing) Is there a way to get the picturebox to redraw the jpg image first then draw on it, in picturebox paint event?
View 10 Replies
Apr 4, 2011
Just want to know if it is possible to do an image mapping in VB2010?..
View 3 Replies
Feb 16, 2012
I am using Visual Basic 2005 for an Operator Interface in an industrial setting. Where should I be looking to help make my Operator Interface even more eye pleasing and practical?
View 2 Replies
Oct 4, 2010
I am having a datagrid in WPF application and I need to show the text wrapped in the cells. Basically I am reading from SQL server and displaying them in the Datagrid. Some of the fields having more than 255 character length and I want to show them as wrapped. To do this, I created my own style and trying to apply that to a data grid cell, but it is not working. [Code]
View 1 Replies
Apr 11, 2009
I'm considering working on a video encoding framework. Essentially a program to re-encode a video file from one format to another, using codecs which are widely distributed. (Codecs commonly found on the average PC.)Emphasis would be on reformatting - rescaling, cropping - in a visual environment. Is vb.NET a good environment for such an application or would it be wiser to look elsewhere?
View 4 Replies
Jun 18, 2009
I'd like to be able to graphically represent a position in a 3D graph and be able to rotate the grid to match a certain perspective. I've looked for tutorials online, but they all mention how to import or create common file types. I don't want or need to do this. I just need to know where to begin. I have the DirectX SDK, but I'm not sure where to start with it and need some direction.
View 1 Replies
Aug 12, 2009
How can I add a scrollbar to my form I tried the auto scrollbar option but is not working ??
How can I validate the user inpute inside a textbox to check that he type the desired word?? for Example validate if the user typed the word ( Bob)?
View 2 Replies
Feb 17, 2009
how can i automatically update my value when a user changs the combobox item. At the moment i have a button click when the user changes the combobox item and press the button the values get updated, everytime the combobox item get changed i have to repeat it click the button to update the value. I want something where automitically as soon as the combobox item selected the total value in the text box to change without clicking the button:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If ComboBox1.SelectedItem = "Seafood" Then
TextBox1.Text = 3.5 * ComboBox2.SelectedItem
End If
View 3 Replies
Nov 30, 2010
I would like to include a bar chart in my program. My present tool box does not have that control. how I can include that control in my tool box.
View 2 Replies