Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Draw Solid Circle?


I would like to draw node.. How to draw solid node?



Quote:




picView.Circle (XY(TIN.Node1, 0), XY(TIN.Node1, 1)), 15, vbRed




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Draw A Full/solid Circle
As far as I know using "Form1.Cirlce (x,y)...." only draws an empty circle.

To make it solid I had to use a FOR-NEXT cycle of circles from the little one the biggest but I don't like this method...

Is there some fast way to make it "solid" in one shot ?!
Thanks.


PS No,I don't want to use the control Shape.

Draw Circle
It is possible to draw circle as the cell border. What I want is actually a circle to encircle the value in the cell.

Thanks for infos.

How To Draw A Circle?
i want to draw a circle onto a dc, so i need to use api

any ideas

Draw A Circle With Cos() And Sin()
Hi,

I don't want to use any api or advanced stuff. Can someone pls tell me how to draw a circle with the functions cos() and sin()? I've seen someone do it but can't rememver how. IT's like lines of the same length pointing out from the centre with even spaces in between each line, more lines there are, the more smooth the edge of the circle will be.

thnx in advance, it's s'pose to be somethin simple....

How To Draw A Circle?
i want to start drawing a circle slowly(not the circle at once!) over a stadium image that i have... (like imagine the circle will be the players running around the field) how can i do that? i want the circle be blue...
also how do i determine where the circle will be drawn and then detect if the circle is complete then show a message....


please help me!
thanks in advance

Draw A Circle?
I have been trying to draw a circle on my form
for the last hour. I cant figure it out.
If someone knows a foruma to loop through every
point of it, I would really appriate it.

Draw Circle
Hey

Im trying to simply create a circle in my code. In embedded VB its simply a command along the lines of darwcircle with the parameters for size, position, colour etc.

Whats the easiest way in VB??

Cheers

Draw A Circle Using Points
I need an algorithm to draw a circle in a picturebox which does not use the picturebox.Circle() method, instead one that does it by creating points in a circle using picturebox.pset(x,y)

Draw Circle With Spins
I have to images attached. The first one is what I did so far... the second one is what I'm trying to do? Can anybody give me a suggestion or mathematical formula?
Here's my code for the first image:


Code:
Dim center As POINTAPI, aux As POINTAPI
Dim big_circle_ray As Long: big_circle_ray = 105
Dim smaller_circle_ray As Long: smaller_circle_ray = 85
Dim bigger_center_circle_ray As Long: bigger_center_circle_ray = 20
Dim center_circle_ray As Long: center_circle_ray = 10
Dim Angle As Double, rad As Double

center.X = Picture1.ScaleWidth / 2
center.Y = Picture1.ScaleHeight / 2

' plot the big circle
Picture1.Circle (center.X, center.Y), big_circle_ray, vbBlue
' plot the smaller one
Picture1.Circle (center.X, center.Y), smaller_circle_ray, vbBlue
' plot the bigger circle at the center
Picture1.Circle (center.X, center.Y), bigger_center_circle_ray, vbBlack
' plot the small circle in the center
Picture1.Circle (center.X, center.Y), center_circle_ray, vbYellow

Angle = 360 / 38
rad = DegToRad(Angle)
For i = 0 To 37
Picture1.Line (center.X, center.Y)-(center.X + Cos(rad * i) * _
big_circle_ray, center.Y - Sin(rad * i) * big_circle_ray)
Next i

Or just tell me how can I "touch" the big circle with this sectors?
Then I can use the equation of the line which passes trough 2 points and do a system with the equation of the circle to find out the coordinates on the circle so that I can do the second drawing.
But for now I don't know why my lines aren't "touching" the big circle like they do on first position (center right, first line).

Draw This Line On The Circle.
i want to draw the top left red line so it touches the edge of the circle.
instead of going to the middle of the circle like the other 3 lines i want it to go from (0,0) like it does, and stop the line when it hits the outside of the circle.
i dunno the maths to do this if anyone can help?

Draw A Circle In A Form
hello everybody,

I am creating an form on which i want to be able to draw a circle, with a variabel diameter.

can someone help me with this.

How Do I Draw A 2D Circle In DirectX8?
How Do I Draw a 2D Circle in DirectX8?

! Draw Circle At Runtime !
Hi,

Anyone knows the code to draw a circle or a box at runtime ?
I already searched on google,

Draw Circle On Form
Does anyone know how to draw a circle on a form. I can do it, but not the way I want to. I want to left click the mouse at the starting point and drag the mouse to the ending point (radius of the circle). I want the circle to be displayed while dragging the mouse. The circle will get bigger as the radius increases. Upon releasing the mouse the circle is complete. I don't know if drag/drop operations will work on a line of a circle. I want the same thing to happen with a line. However, with the line, the line will be visible. With the circle, the radius is not visible, just the circle. If anyone can help with this, it sure would be appreciated. Thanks!

Draw Circle In Picturebox
I am sorry to ask this question but I am very new in VB, I am trying to create a program that can draw a circle in a picturebox based on every mouseclick. Please give me some guidance.

Thanks

Can Be Draw A Curve Line From A Circle?
Hi all. I want to make a curve line, and I have think that a curve can be considerated as a part visible of a ellipse. So I have tried to create a procedure that draws an ellipse.


Code:
dim radius as double
dim bucle as long
dim x as double
dim y as double

radius = 2500
Picture1.Cls

For bucle = 1 To radius
X = Sin(bucle) * radius
Y = Cos(bucle) * radius

Picture1.PSet (((Picture1.Width / 2) + (X + radius)) - radius, ((Y + radius) + Picture1.Height / 2) - radius)
Next bucle

with this. I can draw a perfect circle in the middle of a picturebox ...
but If I only want to display a cuadrant ... how I can know what are the pixels that I want to show, and the pixels that i don't have to draw.

ah ... if there is other methods to draw curve lines, please tell me

Thanks in advance

How Do I Draw A Circle Meter (like A Clock)
I want to draw a circle meter. I want to draw a clock or a speed meter that highlights the time that's completed.

For example..

I want to show a clock, I want to draw a circle and color from 1-2pm in red like a pi graph. How should I go about doing this? Thanks!

Fastest Way To Draw A Filled Circle?
morning all,

subject line says it all really. i have to draw as many filled circles of various sizes & colors as i can in a second.

the various methods i know of doing this are -

vb circle function, with fillstyle = solid
api - not really used these much yet, probably more than a few ways to do it using these i suspect.
direct memory access - havent a clue yet but am willing to learn if its the fastest way

are there others? direct x??

any pointers or input greatly appreciated.

PMF

Draw Circle In Picture Box With Fill
How can I draw a circle into a picture box with a fill color? Thank you

Draw A Movable Circle Programatically
I need to write a class that allows me to draw a circle programatically, and update its position similar to the existing shapes that are available using .top or .left.

Any help on this would be great as im stuck

Malb

Draw A Circle From User Input
The Problem:
Write a program that allows the user to enter the center and radius of a circle in textboxes. Draw that circle in the default color on a form using (-10, 10) as the upper-left corner of the graph and (10, -10) as the lower-right corner of the graph.
--------------------------------------------------------------------------
I added 3 textboxes to the form: txtX, txtY, txtRadius, the user would into X, Y and the Radius and then click on a command button that would make the circle appear. I dimed the x, y and rad and of course put in the x = Val(txtX) etc. Then I put the line
Circle (x, y), radius... but it doesnt do anything. How do I add the (-10, 10) and (10, -10) ? And what is the code to make this problem work ? =(

Draw Line Or Circle In A Picture Box
Hi!
I trying to pass some code in VB6 to VBA but I can find a way to access PictureBox control features like drawing a circle or a line in VBA. Is it possible? I probably need to import a reference like msvbvm60.dll (when I do it, it conflicts with the default object library loaded). Is there another way of doing this?
Thanks in advance, any help is welcome!
Best regards,
Luis Fernandes




Edited by - luisfernandes on 10/14/2003 11:09:28 AM

How To Draw A Circle With Lines Like A Pizza Graphic?
Hi,

How can I draw a circle with several lines inside, like a pizza graphic or a bycicle wheel?
The lines goes from the center of the circle to the border.
The user just enter the number of lines and the program draws the lines automatically, dividing the circle like a pizza graphic.


Thanks a lot for any help...

Michel Jr.

How Can I Draw Small Little Circle Like How Spaces Is ?? Randomly ?
how can i draw small little circle like how spaces is ?? randomly ?

Can I Draw Circle In Front Of Textbox Or Flexgrd?
Hi... sorry bout my newbie question.
is anyone know how to draw circle/line/shape in front of other control like text box, flexgrid,etc?
is it can be done?or can't?

thank you so much.

Solid Mp3 Tag Reader
Hello,

Can anyone point me to a good mp3 tag reader I could use?

Thanks

Solid Tabs
How I can set solid tab with Printer object? Or How I can set solid tabs in Listbox Control, chr(9) is not very useful to my project.

Shapes - Solid?
Hi

I was just wondering if it were possible to make soo that two shapes when they touch that they will either have a msgbox saying you lose or lose a life or something around there.

Any help would be greatly appreciated.

Solid Walls
I am trying to make a simple gaming program where a little picture is moved around the screen by using the arrow keys. I have placed walls (thin lignes) that are supposed to block the image's movement, but the image can just move right past them. Here is my code:
Quote:Private Sub Form_Load()
frmMouvement.KeyPreview = True
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = 37 Then
    imgCd.Left = imgCd.Left - 330
    
    ElseIf KeyCode = 38 Then
    imgCd.Top = imgCd.Top - 330
    
    ElseIf KeyCode = 39 Then
    imgCd.Left = imgCd.Left + 330
    
    ElseIf KeyCode = 40 Then
    imgCd.Top = imgCd.Top + 330

End If

End Sub

Bitblt Solid Color
Hi there!

I am currenlty working on a project with bitblt and a backbuffer and I was wondering...

Can you blit a solid color without using a bitmap? Do I need a different api altogether? I need to put a solid color onto a DC.

Any ideas?


Thanks

Max

Quite A Solid Inventory System
Heya guys,

I've been working on this inventory system for a few days and i'd thought i'd post it up. I havn't really seen anything similiar to this on these forums as yet so if anyone would like to get ideas from it then feel free too, although i wouldn't rely on the code too much as it may be a little inncorrect in terms of "the proper way", which i believe people take seriously on these forums.

Progress
Alright, so far the first tab, which displays character information and the equipped weapon, armour, shield is very functional.
Second tab which displays the current inventory is also functional.
Third tab which displays the currently equipped items is again functional.
The Fourth(spells) and Fifth(quests) tabs, however are not yet functional as i have not yet included them in the main game system.

Just a quick note, there will be some code that is not at all relevant, this is due to the fact that this is only one small section of the overall game that i'm creating so just keep that in mind.

How to Use
Okay, so what you are able to do is Equip an item, remove an item, re-position an item (within the inventory).

To equip an item right-click the item and hit equip.
To remove an item (from the 3rd tab) double click the item.
To re-position the item (within the inventory) drag and drop to a desired position.

Final Words
So anyway what i wanted to get out of this was maybe a few comments or some constructive criticism. Also if you see any bugs, please notify me.

Constructive Solid Geometry
Hallo,

Is it easy in directX to subtract one 3D-object from another?
Like making a hole in a cube?
Is there an easy way to pick objects on the screen?
Before I start learning DirectX I would like to consider all the possibility's

Thanks to anybody who helps me

Anyone Program Vb In Solid Edge?
I am looking for a way in solid edge to open smart view through vb and make it open all the dft files I give to it with out opening multiple instances of smart view. Can anyone help me?

How To Make Something Solid With Bitblt...
Alright ive got the collision detection set up


Code:

Private Sub CheckCollision_Timer()
If Shape1(0).Left < CurX + 72 And CurX < Shape1(0).Left + Shape1(0).Width Then
If Shape1(0).Top < CurY + 61 And CurY < Shape1(0).Top + Shape1(0).Height Then
Beep
CheckCollision.Enabled = False
End If
End If
Thing is isntead of having it beep... what would I have to put in so that the thing that's scrolling wont pass through the box....

I tried setting it up so that it subtracts from the x and y values but that just makes it jumpy... and if its entering from the ooposite side it it just jumps to the point.. so hmmm.. What would I need?

Solid Thick XAxis
Hi everyone,
I tried to make a line graph with as X-axis labels dates from an array. But I get no labels, but a thick (about 3 mm) Z-axis. The code U used is:

Graph1.GraphStyle = 4
Graph1.GraphType = 6
Graph1.GraphTitle = "Slotkoers"
Graph1.DataLabels = 0
Graph1.NumPoints = AantalRegels
Graph1.NumSets = AantalFondsen
Graph1.PrintStyle = 3
Graph1.PatternedLines = 0
Graph1.ThickLines = 1
Graph1.Pattern(1) = 0
Graph1.Pattern(2) = 0
Graph1.YAxisStyle = 0
Graph1.XAxisStyle = 2
Graph1.LabelXType = 1
Graph1.LabelXType = 4
Graph1.TickEvery = 100
Graph1.AutoInc = 1
For j = 1 To Graph1.NumSets
Graph1.ThisSet = j
Graph1.LegendText = NaamFonds(j)
For i = 1 To Graph1.NumPoints
If Left$(Datum(i, 1), 4) <> Left$(Datum(i - 1, 1), 4) Then
Graph1.LabelText = Left$(Datum(i, 1), 4)
Else
Graph1.LabelText = ""
End If
Graph1.ThisPoint = i
Graph1.GraphData = CloseK(i, j)
Next i
Next j
Graph1.DrawMode = 2
Msgtxt = "Do you want to print the graph?"
optval = vbQuestion + vbYesNo + vbDefaultButton1
retval = MsgBox(Msgtxt, optval)
If retval = vbYes Then
Graph1.DrawMode = 5
End If
Graph1.DataReset = 9

Can anyone help me to solve this?

Getting RGB Values From A Solid Color
Its easy to get a colour from individual RGB values by using the RGB(x,y,z) function but how do you go about reversing this and getting the R,G,B values from the colour? Thanks

How Can You Make A Progress Bar Solid?
Hi,

Rather than have a progress bar has a set of blocks next to one another, can you make the entire bar a solid block, which can change depending on the .Value setting??

Any Info,

Thanks

Mark

Solid Black MSflexgrid
When printing a form which has a Msflexdrid on it, every thing else works fine except the grid is SOLID BLACK.
No matter what I do its still solid black.
Even printing to PDF gives me solid black.
It looks fine on the form and also, when doing a Print Screen to the clipboard and pasting to Word it is also fine.
Any ideas

(using Form1.PrintForm)


This prompts me to the next question ... (DataGrid)

Ok I Get How To Draw A Bitmap Onto The Screen, But How To Draw A Tile Map?
i was wondering if its the same idea when drawing a tile map with direct draw instead of bitblt

and how would i use directdraw to draw the tile map. If anyone knows a tutorial for this, that would be just fine(i cant seem to find any).

Making A Soild Object Solid
Using bitblt how do you make a object (picturebox) soild, thanks

Draw_Text + DX8 + Win2000 = Solid Square??
I'm working on a DX8 Game. The Draw_Text function works fine on my WinXP machine and any other that I try it on, but on any Windows 2000 computer I run the code on, I get solid boxes where there's supposed to be text...?

They are all running the same version of DX (8.01)

Also, I tried running the code on a laptop that had DX9.0a and it failed at this line:

Set D3DDevice = D3D.CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, frmMain.hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, _
D3DWindow)

(changing it to HARDWARE didn't help either)

I'm less concerned about that right now, but if anyone knows anything about that would be great.

Has anyone ever had a problem with Draw_Text making big squares of the color your text is supposed to be? Like I said, it works like a champ on my XP machines.



Thanks

Solid Picturebox Like Frame Behaviour?
I have a stupid MDI form, which wont let me drop controls on. So like the VB IDE im using a picture box aligned to the left, and one to the right to drop controls on. And in between both picture boxes, directly onto the MDI form i have a child which is loaded. What i need to do is make the child form stay in between the 2 picture boxes at all times. So if you move the form it cannot go underneath the 2 picture boxes, and the same applies if you resize the child form.

Thanks for any ideas

Form Transperancy, Label Solid
I want to have my form invisible, but have the text in the label become visible so that only that text shows. Can anybody help?

Thanks in advance.

VB6: Transparent Form - Solid Controls
I am working on an Application which I have based on several frames.
There is one central frame, and, as required, the other frames 'slide'
out from behind it.

The problem is that this requires a large form to keep room for all of
the various slides.

I want to have the form transparent, and have mouse events
pass-through to whatever is behind it. I have done some searching and
have found the commands to make a form transparent - but this method
also affects all of the controls contained in the form - this is no
good for me.

My other option is to make each frame a separate form, but then it
starts looking a little ugly with so many form toolbars etc. I can
have the toolboxes etc. removed from the form, but I am curious to
know if my original vision is possible.

Any suggestions?

Thanks,

Trevor.

Display A Solid Square Composed Of Character
Write an application that displays a solid square composed of a character input by the user. User will also input size.

Looks like this if you input 8 for the square size and # as the fill character:

########
########
########
########
########
########
########
########

Need a subprocedure called 'DisplaySquare'.
Size is determined by first txtbox - txtSideSize
Fill is determined by second txtbox - txtFillCharacter

Must have 2 nested For...Next statements.
first is outer - and specifies what row is currently being displayed
second is inner - and appends all characters that form the row to a display string.

This is what I have so far:
Code:
Private Sub btnDisplaySquare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplaySquare.Click
Dim intSize As Integer 'size of square
Dim strFillCharacter As Char 'character to fill the square

intSize = Val(txtSideSize.Text)
strFillCharacter = txtFillCharacter.Text

'call DisplaySquare sub procedure
DisplaySquare(intSize, strFillCharacter)
End Sub 'btnDisplaySquare_Click
'display square
Sub displaysquare(ByVal intsize As Integer, ByVal strfillcharacter As String)

End Sub


I don't know how to set this up to take the intsize and make that the length of each row and also the number of rows...
And to make the fill character whatever character is inputted by the user.

please help....

Thanks!

How To Hide A Control With Solid Colour - What Properties?
Good Evening

I have tried this in VB6 but I am still not 100 percent sure if this right-

I want a control on the form to have a solid colour that won't show through the colour of the form it is placed on.

This is what I think is done to achieve this:

Modify STYLE Property – Set to 1 – Graphical, which turns the control into the same colour as the background

Modify VISIBLE Property – Set to False which sets a value to determine that the object is hidden

Does anyone know if this is correct or is it some other property I use.

I just want on this application for one control to appear to test a condition I am doing.

Any assistance grateful for.

[ABANDONED] Solid Background Using FillRect - Need Transparent
I've set up a diagonal cross brush with:

Code:m_pbPens.BrushCrop = CreateHatchBrush(hsHatchStyle.HS_DIAGCROSS, RGB(128, 0, 0))

I apply it to a DC with FillRect:

Code:rctBox.Left = 0
rctBox.Top = 0
rctBox.Right = intWidthF
rctBox.Bottom = m_intOffsetTop
FillRect lnghDC, rctBox, m_pbPens.BrushCrop
FrameRect lnghDC, rctBox, m_pbPens.PenText

It's applying the crosshatch, but the background is white. I want the DC's image to show through. When I use the pen through the PictureBox Line method (Box, no fill), it has a transparent background. How do I get this effect with API?



Edited by - AbbydonKrafts on 10/25/2006 8:18:50 AM

How Do I Draw A Line Without Using Direct Draw??
I got the x and y coordinates of the pointer. How can i draw a line with that coordinates. I can´t use Direct draw ( sitting on a NT station). I have some idea of catching the movement in shootergames like Q3. Then i can compare it to other gamers. Good idea? Yeeeah!

Owner Draw Code Not Holding On Owner Draw Button?
I'm trying to make owner draw buttons for XP usage.  More specifically, the WP_SMALLCLOSEBUTTON (the close button on a dialog window).  I'm using an owner drawn button, MsgHook.DLL to hook into the messages, and WM_DRAWITEM message.  But the drawing code does not hold.  It draws, then quickly gets erased.  If you click on the button quickly, you can see the image flash and disappear.

Information and code:

Form: AutoRedraw = False
Button: Style = 1 - Graphical

WM_DRAWITEM message handler

dim lpDIS as DRAWITEMSTRUCT
CopyMemory lpdis, byval lparam, len(lpdis)
if lpdis.hwnditem = command1.hwnd then
    DrawButton lpDIS, hwnd
end if


DrawButton code:

Public Sub DrawButton(lpDIS As DRAWITEMSTRUCT, hWnd As Long)
    Dim bPushed As Long
    Dim mTheme As New cUxTheme
    Dim hdcMem As Long
    Dim hbmMem As Long, hbmOld As Long
    Dim hbrBkGnd As Long
    
    'hdcMem = CreateCompatibleDC(lpDIS.hDC)
    
    'hbmMem = CreateCompatibleBitmap(lpDIS.hDC, (lpDIS.rcItem.Right - lpDIS.rcItem.Left), (lpDIS.rcItem.Bottom - lpDIS.rcItem.Top))
    
    'hbmOld = SelectObject(hdcMem, hbmMem)
    
    hbrBkGnd = CreateSolidBrush(GetSysColor(vbButtonFace And &H1F&))
    FillRect lpDIS.hDC, lpDIS.rcItem, hbrBkGnd
    'FillRect lpDIS.hDC, lpDIS.rcItem, hbrBkGnd
    DeleteObject (hbrBkGnd)

    bPushed = ((lpDIS.itemState And BST_CHECKED) = BST_CHECKED) Or ((lpDIS.itemState And BST_PUSHED) = BST_PUSHED)

    'SetBkMode hdcMem, OPAQUE
    SetBkMode lpDIS.hDC, TRANSPARENT

    If bPushed Then
Form1.Caption = "Pushed"
        DrawFrameControl lpDIS.hDC, lpDIS.rcItem, DFC_CAPTION, DFCS_CAPTIONCLOSE Or DFCS_PUSHED
    Else
Form1.Caption = "Normal"
        DrawFrameControl lpDIS.hDC, lpDIS.rcItem, DFC_CAPTION, DFCS_CAPTIONCLOSE Or DFCS_FLAT
    End If
    
    'BitBlt lpDIS.hDC, lpDIS.rcItem.Left, lpDIS.rcItem.Top, lpDIS.rcItem.Right - lpDIS.rcItem.Left, lpDIS.rcItem.Bottom - lpDIS.rcItem.Top, hdcMem, 0, 0, SRCCOPY
            
    'SelectObject hdcMem, hbmOld
    'DeleteObject (hbmMem)
    'DeleteDC (hdcMem)

End Sub

If tried it both ways.  Creating a compatible back buffer DC then BitBlt'ing onto the button's HDC, and drawing directly on the button's HDC.  Neither one of the options hold.  I know it's entering the function, and getting the correct state because the forms caption changes with the form1.caption = * statements.  Any help with this would be GREATLY appreciated.

On, one more addition, this particular function doesn't attempt to use the theme class, but still does the same thing.  You can see the X on the close button flicker when you click on the button quickly.

Copyright © 2005-08 www.BigResource.com, All rights reserved