Cause An Event - Draw A Solid Black Line 25 Pixels From The Top Of The Form?

Jan 31, 2012

I see that the Line method is replaced with DrawLine, however; it seems like DrawLine must treated as an object as follows:

Private Sub Form1_Paint(ByVal sender As Object, ByVal e _

As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

Draw a solid black line 25 pixels from the top of the form.[code].....

When I attempt to use this code (call it), I must somehow bring about an event, but I haven't found how to do that.How do I "call" this sub?

View 13 Replies


ADVERTISEMENT

How To Draw A DASHED Line Instead Of A Solid Line

Aug 22, 2010

I am graphing using Visual Basic graphics and it works. I would like to know how to draw a DASHED line instead of a solid line. Could someone help me with this?gphFormGraphics.DrawLine(Pens.Green, pt2, pt1)

View 4 Replies

Pixel Counter - Count The Black Pixels The Grey Pixels The More Grey Pixels

Jul 27, 2009

I'm trying to make a -what i thought would be simple app.My intention was to build program that:1) i'd provide a grayscale image2) the program would count the black pixels the grey pixels the more grey pixels etc. (the hue) and the white3) would make the percentage sum of all pixels, that is: 300.000 black pixels (rgb 0 0 0) etc. given that 0 is the black, 100 the white. e.g a simple grayscale image is 55.2 white

This was my way and i don't think that is useful:

First of a button to convert the image to greyscale:

Dim bm as new Bitmap(source.Width,source.Height)

Dim x

Dim y

[CODE]...

Secondly, -and that's the stupid way- i did -or better i wanted to do- this: i put the code to dynamically create labels, each label having the colour of a pixel as background colour and as text the colour converted to rgb

The third step which i intended to do (i couldn't get pas two) was to sum up the labels etc.

View 6 Replies

How To Draw Black Line Across Center Of Picture

Feb 19, 2010

I have to draw a black line across the center of the picture from one side to the other, how do I do that. Here is the code:
Dim bmp As Bitmap
Dim x, y As Integer
Dim pixel As Color
lblLeft.Image = Image.FromFile(tbFileName.Text)
bmp = Bitmap.FromFile(tbFileName.Text)
' manipulate bmp here
lblRight.Image = bmp

View 1 Replies

Creating A WPF Application To Draw A Straight Black Line On A Canvas

Aug 16, 2010

Under the MouseLeftButtonUp event handker store the first coordinates of the lines second endpoint. Then call the length method to obtain the distance between the two endpoints(the lines length). Fianlly display the line on the canvas and the line's length in the Length=Label. Below is the code I have so far. There are no errors, but when I run the application nothing happens.

Private Sub lineCanvas_MouseLeftButtonUp(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArg... Handles lineCanvas.MouseLeftButtonUp
Dim distance As Double
endPoint = e.GetPosition(lineCanvas)

[Code].....

View 2 Replies

How To Count Black Pixels In A Bitmap

Apr 19, 2009

My goal is to iterate through each pixel determining whether it is black or white. Ideally I want to do this one row at a time (so I can count the number of black pixels in each row). This is a bitonal image.I tried to get it started, but I don't understand what value(s) I'm supposed to be polling for. The following code takes a stab at it (i.e. makes a guess as to what value I'm supposed to check) and then outputs that value to a textfile.When I read the textfile, though, it doesn't look like anything useful.This code is an attempted modification of some code found in a CodeProject article.[code]

View 5 Replies

VS 2008 Count The Number Of Say Black Pixels In Picturebox?

Jul 12, 2010

is there anyway i could count the number of say Black pixels in my picturebox say i have a picture in it that has 1 black pxiel i would like to to but that to a string so i could put it in a textbox or a msgbox like this

so in RGB black would be 0-0-0 but how would i have it scan the pixtuebox and count how many pixels show up with the rgb color 0-0-0

View 10 Replies

Color.FromName To Return A Solid Black Color When The Function Doesn't Recognize Any Text In The String Passed To It?

Jan 29, 2012

[URL] That way if the string that is not recognised that is passed to Color.FromName it returns a SolidColor of

Color.Black = Color.FromARGB(255,0,0,0)

That way, Forms and controls that only support SolidColors are supported.Installing VB6 on Windows 7?

View 15 Replies

Winforms - Create Image With Width And Height 64 And Set All Pixels To Black?

Jun 21, 2012

i want to create image with width and height 64 and set all pixels to black

dim b as bitmap
b.width = 64
b.height = 64

[code]....

the code not working

View 1 Replies

Draw A Line Over A Picture Box Using The Paint Event?

Apr 7, 2011

How would I draw a line over a Picture Box using the Paint event? I can draw the lines but they are drawn under the Picture Boxes.

View 6 Replies

Can't Get A SOLID Line In .NET, Just Hashed

Oct 14, 2010

I'm trying to draw a solid line if VB.NET the way I can in VB.What I WANT to do is set the pentype to solidcolor, but it says pentype is read only and you have to instantiate the brush as the pen type that you want, SO ... I do this:

Public myBrush As New SolidBrush(Color.Red)Public p1 As New Pen(myBrush, 5)

And what I get when I draw a line is a pen type that is hashed. It's a bit weird, too. The line I'm drawing is between captures of the mouse position and if I move the mouse really fast, I get an almost solid line, but if I move the mouse slowly, I get a hashed line.

View 10 Replies

Replace Dashes With A Solid Line?

Feb 23, 2012

I am using word 2010 VBA to clean up a "dot matrix" looking report. One thing I want to do is replace a row of dashes with a solid line. I think the code would look something like this:

count strings = "-------------------"
for each strin (i)
select string
delecte selection
move up
insert solid line
next (i)

Or if it can be done as a find and replace all that would be even better, but I cannot find how to replace a row of dashes (text) with a line object.

View 1 Replies

Draw A Line In VB Form?

Jun 21, 2010

How can I do the same thing with other shaped like rectangle?

I know that I need x,y,widht,height but it still don't do my rec.

View 1 Replies

Draw A Line On A Form?

Jul 16, 2009

in vb.net i would like to draw a regular line on a form. is there a control to do this?

View 2 Replies

Draw Line Outside Form With VB?

Oct 10, 2010

I want to move cursor with visual basic and it seems I found way how to do that. It is possible even click with Visual Basic whereever on screen. But I cannot check out where on the screen the click was done and so I want to draw two short crossing lines on that point as marker where Visual Basic clicked on screen. If it is possible to move cursor to that position and show it then it is as good as drawing marker.

View 4 Replies

Draw Single Pixels And Rectangles On Any Web Browser?

Nov 17, 2010

My aim is to draw single pixels and rectangles on any web browser.

I ve been thinking alot about this and I think I that there might be 2 ways to do this:

1) Send message api maybe?

2) Direct 3d hook with C++ (Although this is quite complicated)

So my questions are:

Btw the use for it is to detect a certain pixel on the webbrowser and draw on it.

Don't ask why since it is quite complicated and I know also how to use Send message api and I once managed to program a direct 3d hook (but for a 3d game which was based on direct x SDK) with C++ although im not sure if it will work due to webbrowsers dont work with directx.

View 7 Replies

Draw A Black Border Around A ToolStripButton?

Oct 3, 2011

I am trying to draw a black border around a ToolStripButton. This is the code I am using and it only draws the border on 2 sides. Dim clrMenuBorder As Color = Color.Black Dim borderPen As New Pen(clrMenuBorder)

Dim rect1 As New Rectangle(0, 0, e.ToolStrip.Width, e.ToolStrip.Height)

e.Graphics.DrawRectangle(borderPen, rect1)

View 7 Replies

Draw A Shape In GDI+ That Overlays Opaque Pixels With Transparency?

Feb 24, 2010

I have a mask bitmap (bmpMask) that I am drawing onto a destination bitmap (bmpDest). Both bitmaps have alpha channels but are already full of opaque content. What I want to do is produce transparent areas using GDI+ 'Draw...' methods on bmpMask so that bmpDest shows through when I draw bmpMask over it.Of course gMask.DrawLine(Pens.Transparent, 0, y, wMax, y) causes no change to bmpMask, because GDI+ works as designed and doesn't draw anything when transparent. Even with semitransparent colors, only the r,g,b values of bmpMask's pixels are updated.

View 1 Replies

Owner Draw Tooltip Shows Up As A Black Box

Aug 29, 2011

I have created tooltips on a form from the toolbox and defined them as owner draw. I tied them to either a panel or a grid and they show up as black boxes the size that would contain the text that is assigned. If I had two areas next to each other, the text shows up. Neither the background or the forground color is black, so the black of the box is not from a color assignment. This has worked at one time and I do not know what changed.

View 2 Replies

Draw A Line Grid On A Windows Form?

Dec 26, 2009

I need to draw a line grid on a windows form that contains 4 rows and 4 columns.

View 2 Replies

Draw Rectangle On Image Where Color Pixel Is Black?

Mar 17, 2011

I want to draw a rectangle on image where color pixel of image is black

View 1 Replies

CheckBox Control Draw That Black Check Mark In White Box?

May 19, 2010

How does the CheckBox control draw that black check mark in the white box? I can't install .Net Reflector or anything here on my work machine so could someone post the code (vb.net or c# is fine with me)?

Or if anyone knows how to do it (I have an 8x8 Bitmap object I'm drawing on already) I'd like a hand since my math isn't working out correctly[code]...

View 4 Replies

Draw Shape On A Form Using Mouse Down Event In Vb?

May 9, 2009

I've to draw LInes and rectangles,etc in vb on a form and using mouse down event.

View 2 Replies

Programmatically Reset Form Background From A Picture To A Solid Color?

Nov 13, 2009

How can I programmatically reset my form background from a picture to a solid color. I have no trouble changing it to a picture or even changing it to another picture, but when I try to change it back to a solid color, it won't work.

me.backcolor=color.red 'OK
me.backgroundimage=my.resources.dog 'OK
me.backgroundimage=(none) 'error
me.backgroundimage=my.resources.none 'error

How do I reset it back to a color? It's stuck in a picture mode.

View 2 Replies

VS 2010 - Draw A Straight Line Between Two Points And Calculate The Length Of That Line?

Jan 3, 2012

I have a picture in my picturebox. In that picture, I need to draw a straight line between two points and calculate the length of that line (probably in pixels). Is there any suggestion how to do it?

View 2 Replies

Make Scrollbars A Thin Black Line?

Apr 9, 2010

Is it possible to make the scrollbars in my webbrowser a thin black line which moves up and down, instead of the usual ones?So its just a black line (maybe 3pt thick) which is OVER the content, on the right hand side. So as you scroll the black line changes size like a normal scrollbar, but it isn't separated from the content, its actually over the top of it.Sort of like the scrollbars on an iPhone if you've seen them.

View 3 Replies

Forms :: Uses A Button To Draw A Line And A Second Button To Draw A Rectangle?

Oct 14, 2011

I have a form that uses a button to draw a line and a second button to draw a rectangle. I have a third button to clear the form but can't find a code example to code the Clear button.

View 4 Replies

Make The Main Form Grey Out/translucent Black When A New Form Opens On Top?

Jul 9, 2010

How can I make the main form grey out/translucent black when a new form opens on top?

View 8 Replies

Draw A Line In VB?

Mar 31, 2010

For class, I am creating a Tic Tac Toe game. When there is a win I would like to draw a line over the 3-in-a-row. Not sure if this is possible because I used an array of buttons to represent the X's and O's. If this is not possible I would like to highlight the winning buttons.

View 14 Replies

Way To Draw A Line

Apr 10, 2010

Surely its possible to draw a line in Visual Studio without writing a dozen lines of code?

Is there a drawing toolbox that's hiding from me?

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved