Drawing A Gradient In Visual C++ 2008?
Feb 9, 2010
I'm trying to draw a simple rectangular gradient but I keep getting this one error. Here is the code below: Drawing::Rectangle^ myRectangle =
gcnew Drawing::Rectangle(10, 10, 100, 100);
Drawing2D::LinearGradientBrush^ myGradient =
gcnew Drawing2D::LinearGradientBrush(myRectangle ,Color::Red, Color::Blue, 50);
e->Graphics->FillRectangle(myGradient, 20, 30, 100, 100);
View 7 Replies
ADVERTISEMENT
Jun 29, 2009
This may be a stupid question, but is it possible to add things like lines to a form easily? Without creating the line manually using System.Drawing?
View 5 Replies
Apr 26, 2011
I've got all the code figured out to make a picture box appear with a gradient inside of it. My problem is that the gradient doesn't appear in the picture box when the form loads, paints, or when the picture box is painted. I can only make the gradient appear if i click the picture box after the form appears.
Dim xFormTopColour As Color = Color.Black
Dim xFormBottomColour As Color = Color.DarkOrchid
Private Sub frmTestGradientBars3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call GradientPictureBox(xFormTopColour, xFormBottomColour, picSample)
[code]....
View 2 Replies
Sep 2, 2009
The problem is I have 10 nodes(say) and there are some connections between them. Now I want to draw a visual graph depicting the above with circles as nodes and lines as connections between them. My problem is what is the algorithm for placement of nodes on screen, say we have drawn one circle, then the other circle should be drawn as non-overlapping as possible.
View 1 Replies
Jul 7, 2010
I am trying to create an autocad drawing in visual studio with the code :
Dim strTemplatePath As String = "C:\acad.dwt"
Dim acDocMgr As DocumentCollection = Application.DocumentManager
Dim acDoc As Document = acDocMgr.Add(strTemplatePath)
acDocMgr.MdiActiveDocument = acDoc
However, when I try to run the program I get an filenotfoundexception and the program asks me to verify if the file exists in the specified location. The file does exist in the specified location.
View 1 Replies
Jul 18, 2012
I am unable to find line , oval ,rectangle etc Drawing tools in Visual Studio 2010 I am also unable to find VisualBasic.PowerPack
View 1 Replies
Jun 21, 2010
I'm constructing a Management system. Now, I have a problem with the interface design.
I wish to use ForumsAccount's tab control and JuggaloBrotha's gradient form in my application (both can be found in CodeBank).
But the problem is, I'm confused in the design ! Which one shall I use for the main form ? an MDI form or a normal form ?
Details about the Mgmt. System app: it will be used to manipulate everything for a small firm, like adding customers, employees, payments, etc.. Everything is managed using the app and saved to the db.
View 11 Replies
Aug 30, 2011
I have an desktop application that references several dlls. All are targeted for .Net 3.5, x86. The applicaiton has been deployed for several years and was upgraded from visual studion 2008 to 2010 last year. I have made several changes to the app since then (as recently as last Thursday) with out any issues. Now, everything builds, but when I run the application, I get a type initialiazer error when one of the projects is loaded by the main application.
The error messsage is {"Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.":"System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"}.
There were no changes to this project since the last successfuly deployment last week, but today I am getting this error.
View 14 Replies
Mar 4, 2012
I've decided to learn Visual Basic .Net as this is what some of my colleagues work with, and this will allow me to work with them on projects.I have purchased Microsoft Visual Basic 2010 Step by Step and downloaded the sample files. When I am trying to debug the first sample application (a Windows form), it is telling me that it can't load System.Drawing V4.0.0.0. However, if I create a new Windows Form application (C# or VB.Net) this works fine.
I had a look at the References tab in the project settings and System.Windows.Forms is referenced, but the version referenced is 2.0.0.0. I have removed and re-added this reference and it stays at 2.0.0.0 and I still get the error.Does anybody have any ideas as to what may be going on?
View 2 Replies
Mar 28, 2009
Visual web developer 2008's .sln file is not working in Visual Studio 2008
View 2 Replies
Jun 3, 2012
draw individual pixels, without resorting to drawing a line and setting it's length to 1. Is there an actual ability to draw a pixel that is just 1 pixel big?
View 2 Replies
Aug 19, 2009
I have a little experience with drawing using GDI+ in VB.NET, but not so much with more complex shapes. All I ever used were lines and rectangles, and the occasional ellipse.I need to draw an 'arc' like this:I can specify the starting angle (0 in the picture), ending angle (angle from the horizontal (left side)), and the starting and ending radius, and I'm sure any other things I need can be calculated from that.The problem is that I have no clue which drawing function to use. Can I do it using FillPath, or FillClosedCurve, or? Of course, I could create a pie shape and then draw a second pie shape (slightly less radius) on top of that to make it appear like it's a single shape, but what if it needs to be 'transparent'? I don't want it to draw a solid shape on top.
View 17 Replies
Feb 18, 2012
I need some code to draw a resizable, draggable rectangular cursor (or selection box) on a picturebox. I found some excellent code (albeit rather old) that does just that, but on a form rather than a picturebox. I have tried converting the code - basically moving things to the picturebox events (Paint, MouseDown, MouseMove etc). It nearly works but leaves a trail behind it when you move or resize the cursor. In other words, the selection rectangle is not being erased before being drawn in the new position.
Is there some fundamental difference between drawing graphics on a form and drawing on a picturebox that would cause this behaviour? Something like, when you invalidate a form and cause a redraw it erases what you did last? If not, then I just need to dig a bit further and work out how the cursor is being erased from the previous position.
Here's the original code that works fine on a form:
Private DragRect As New RectangleF(20, 20, 100, 80)
Private Adornments(7) As RectangleF
Private MouseInRect As Boolean = False
[Code]....
View 1 Replies
Jan 17, 2011
In a while loop, I am writing a progressively increasing integer value (between 0 and 100) to the Value attribute of a ProgressBar control, when it disappears from the window in which it resides. I have verified at the time that it disappears that the Min is 0, Max is 100, and Value is a valid integer in range.
View 9 Replies
Mar 20, 2009
How do I disable the background compiler for Visual Basic in Visual Studio 2008?
For my sins, I have to work on a large VB.NET project and it often locks up for 20 seconds at a time whilst doing the very helpful background compilation
I'd rather work blind between compiles and be able to do some work.
View 1 Replies
Jan 22, 2010
I am trying to make a console program in Visual Basic on Visual Studio 2008. I want to ask the user of the program if he wants the premium version or the standard version. If he chooses the premium version, then I want it to say premium in his "receipt" later on and if he chooses standard, then standard in the receipt.
[code]...
View 1 Replies
Sep 26, 2009
I have Visual Studio 2008 Professional and I'm trying to make it so I can click a button to send the application to the System Tray and then click the icon in the System Tray to make the application come back.
Can anyone provide me a method or sample code to do this?
View 8 Replies
Apr 24, 2012
I have made a program in which a small space ship rotates, with some tutorials I found, then when i tried to move it I realized that .location does not work for bitmaps..
View 1 Replies
Sep 2, 2010
I have a Custom Groupbox that overrides the OnPaint event to do some custom drawingbackgrounds, etc. The problem I have is that when I use it in an application and want to draw text on the control, it gets drawn first, then immediately afterwards the OnPaint from the control gets called and draws on top of the text. Is there any way to get the text drawn after the control's OnPaint?
View 1 Replies
Sep 12, 2009
Dim fnt As New Font("Verdana", 16)
Protected Overrides Sub OnPaint(ByVal pe As PaintEventArgs)
Dim g As Graphics = pe.Graphics
[code].....
View 17 Replies
Apr 23, 2009
I am having a bit of trouble drawing a grid with GDI+ and VB.net 2008. The grid is designed as one point perspective. The horizontal lines are not correctly positioned, and the form is taking a long time to draw. Could anyone suggest a faster, and mainly more accurite method?
Here is my code currently:
Public Class Form1
Const VanishPoint = -200
Dim g As Graphics = Graphics.FromImage(New Bitmap(Me.Width, Me.Height))
[Code]...
View 2 Replies
Oct 16, 2009
I want to draw a line on a image, easy enough in principal the image is a map and the lines is between city pairs?
View 12 Replies
Feb 2, 2011
I have my application to where you can load up an image and draw on it with the mouse left down and drag.Only problem is, if the form becomes the inactive one or is minimized/maximized the drawings go away until I scroll the image in the form (I put the redraw functionality in the picturebox.Paint event).How can I make the lines I draw stay permanently? I've put picturebox1.refresh in the minimizedchanged/maximizechanged and form.activated events and still nothing..Even tried the picturebox's resize event and nothing?
View 18 Replies
Dec 21, 2010
I'm trying to draw text on the progressbar. This code below works, but when the progress bar re-paints itself the text disappears.
ProgressBar1.CreateGraphics().DrawString(Vaule & "%", New Font("Arial", CSng(8.25), FontStyle.Regular), Brushes.Black, New PointF(ProgressBar1.Width / 2 - 10, ProgressBar1.Height / 2 - 7))
jmcilhinney suggested i look into the PaintEventHandler.
I read the MSDN documents, but they used PictureBox(). I made this code below, but no luck.
[code]....
View 4 Replies
Sep 30, 2009
my assignment is to draw a graph within my VB form with a some variables I have. I was told by my boss that I should use Microsoft Chart Control 6.0, but I don't think it matters if it is in another software.I currently have a few variables, each with a lot of values, "Frequency", which is user entered from maximum to minimum, CH (channel) 1-4 which are given by a machine output I use at my company. My graph, is supposed to have the Frequency values in the X-Axis (horizontal) and the CH 1-4 values within a range of each other in the Y-Axis. Can anybody help? My code for extracting the data and getting the frequency is below. How I got most of it is thanks to Stanav, the thread is over here: url...It comes with 3 buttons (I have not put in the code for button 3), the 3rd button will be used for plotting the graph when clicked.
View 3 Replies
Sep 2, 2010
I have a Custom Groupbox that overrides the OnPaint event to do some custom drawing,backgrounds, etc. The problem I have is that when I use it in an application and want to draw text on the control, it gets drawn first, then immediately afterwards the OnPaint from the control gets called and draws on top of the text. Is there any way to get the text drawn after the control's OnPaint?
View 3 Replies
Jan 13, 2012
I am very new to Visual Studio Application Development. I'm mostly a DB guy. I used Visual Studio as a Report Designer, not much of an .Net guy though I can understand it. I am now asked to create a .net application and I'm trying to create a "Hello World" starter app. I opened my Visual Studio, click File-New Project and all I see is Business Intelligence Projects and Other Project Types. My step-by-step guide says choose Visual Basic, Windows Forms Application. But I can't see it as an option.
View 2 Replies
May 22, 2012
I recently loaded my copy of MS Visual Studio 2008 Standard Edition, with Visual Basic, on to my new laptop, one with a Windows 7 operating system. This version of Visual Studio had been on my other laptop, a Windows Vista machine. When I attempt to run any of my Visual Basic applications which has a MSFlexGrid container on it, I get this error message "Unhandled exception has occurred in your application... The error is: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG). Also,
View 2 Replies
Dec 19, 2009
whilst trying to debug a sample program, get error code bc 32400. Also error code Class 'CLSID_CorSymWriter' could not be created system error &H80040154&
View 3 Replies
Jun 21, 2010
Say I have 3 Buttons, labelled: Unit 1, Unit 2 and Unit 3. When I click on any button I want a drawing of that unit to appear on screen at a pre-specified starting point. Thereafter when I press any other one of the buttons the unit drawings appear alongside each other in a line. So I could end up with:
[Code]...
View 4 Replies