VS 2010 Drawing Complicated Pattern
Aug 13, 2010
I am refining my VS2010 control renderers and I'm working on the TabControl at the moment. If you take a screenshot of the VS2010 IDE and zoom in on the background of the TabControl (where there are no tabs), then you might see that it consists of a pattern of dots with a slightly different color than the surrounding background. I am trying to draw these dots (yes, I'm going for perfection), but I cannot find a brush that allows me to do this.I am pretty sure I'd have to use a HatchBrush with the right HatchStyle, but I cannot find a matching style.Here is a screenshot showing:
1. The VS2010 background I'm trying to draw (higher contrast and brightness otherwise it's hardly visible),
2. The HatchStyle that is closest to this (DottedDiamond)
3. Why this HatchStyle is not correct (it's missing dots where the green dots are, which I photoshopped in).
Now of course I'm going to have to draw the pattern twice (there are two patterns, offset by 1 pixel, with a slightly different color), but the more pressing problem is the green dots seen in the third image. They aren't there with the DottedDiamond style, and no other style (I think I've tried them all, but hey I might have missed some..) produces a better output.
View 4 Replies
ADVERTISEMENT
Nov 29, 2010
I'm using vb10.
Is it possible when drawing a line to use a binary pattern? Is there a command for this?
Example:
167 is 1010 0111
Draw a line X32 x Y1 would be: 10100111101001111010011110100111
205 is 1100 1101
Draw a line X32 x Y1 would be : 11001101110011011100110111001101
1's being pixels drawn and 0's not.
View 2 Replies
May 8, 2011
I have an interesting project that i would like to complete. I have a batch file used to ping our locations. Has 1 simple input but i dont understand how to get this to work in visual basic 2010.
View 19 Replies
Jun 19, 2012
I am trying to parse a string that contains known and unknown characters.here is an example:
[1]Tue Jun 19 17:14:15 2012, 48:17:4C:00:00:74, 4.8, 5449,816324, 26, 31397, 160855, 30775030, 29962782, 812248, 2394476, 71619, -44, -67, 46, -60, 51, 0, 86468, 2547055, 4687358, 44278, 4593, 65076, 65191, 65106, 65166, 65108, 64552, 64572, 64512, 5.1, 2548502, 4690906, 520, 0, 0, 0, 36, 2412
[code].....
The known part is the [0] or [1] or whatever number in the brankets.the unknown part is the rest of the message.So if i have this string i want to cut it to smaller substrings that start with [ and end before the next [ .To make it more tough, sometimes, before the next [ there is another message that comes like: Jun 19 17:13:40 2012 timestamp And after that it continues with the next [
View 10 Replies
Apr 20, 2011
I'm trying to find a tidy way to set a string using an if else statement according to a numeric value. The only complication is that there is a possibility that this value may contain text. So it needs to handle that situation too.
So this is the basic code:
If cint(QtyShop) > 0 Then
msg = "Stock found in this shop"
ElseIf cint(QtyAllShops) > 0 Then
[code]....
View 1 Replies
Nov 15, 2010
I have a program I made in VB 6 which has probably hundreds of thousands of lines of code.
Is it complicated to convert it to VB.Net or is it not worth it?
My main problem is that VB 6 doesn't work in Win 7 so I need to use the XP emulator each time I make an update.
View 16 Replies
Jan 17, 2012
Has anyone ever used VB to analyze data to find patterns? I would like to analyze several hundred sequential data points to look for a fairly uniform "up-down" pattern, very similar to a square wave.
View 3 Replies
May 18, 2012
a debate has been sparked here about the use of the strategy pattern in my classes.
Basically, I have a 'Shape' object that is an interface 'IShape'. We have 'Circle', 'Rectangle' and 'Elongated' that are the concrete classes that must implement the IShape interface.
[Code]...
View 3 Replies
Jan 21, 2012
have a 1mb file, should get the pattern from it
pattern should be like this
6numbers + 10&FF + 6numbers
in the hex binary editor it looks like this
[code].....
View 4 Replies
Jul 1, 2011
I need an extremely simple regex pattern that matches anything within square brackets [].
Example:
This is a [test] text with [some] [examples].Required results: [test], [some], [examples].I don't want to get rid of the brackets, they should be included in the result (that should make it easier, right?)
If possible I'd like to exlude results that have whitespace in them, so things like [this string] should not be matched. If that gets too hard (probably not, but hey I can't even manage this :S) then I don't really mind, I can always check if the result contains whitespace myself.
I tried a lot of examples I could find online and ones that I could think of myself but none work. Note: I've been testing with the Visual Studio Find dialog (checking to use regular expressions obviously), maybe that's where the problem lies, because I don't really understand why some of these don't work...
Anyway, first thing I tried was simple: match the two brackets and one or more characters in between (that should be a +, right?)
View 4 Replies
Mar 24, 2010
I am a total bginner to vb.net programming. I am trying to make a simple program that allows the user to
1.change desktop background
2.Allows the user to select a boot image listed in the form
3.alows the user to enable disable the task manager,registry editor and control pannel.Replace Windows Boot image (Picture source is a picture box in form)
4.Change XP Start Button Text
5.Disable/Enable Windows Keys
so this is how far I got;
Imports Microsoft.Win32
Public Class Form1
Implements IDisposable
[code]....
View 3 Replies
Mar 16, 2011
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
View 3 Replies
Apr 24, 2012
It seems up until now I've never used Regex, nor even heard of it. But once I did I realized how extremely useful this is. Having said, it's been 2 days since I've began looking into constructing my own patterns. My most recent being for decimals. Is the pattern I provided below "proper"? and are there also any improvements I could be making for a more efficient patter, which would minimize any possibility of a loophole? [code] So for my use, this is doing what it's supposed to being doing under every test I can through at it. But do mind the 0. and .0, I have a function to normalize these as they are proper, I just pad the left and right accordingly. I found most regex questions asked here..and yes I am doing this in vb.net so it fits. If not, then feel free to move this post somewhere else better suited for the topic of discussion.
View 12 Replies
Jun 11, 2011
Does .NET have built-in techniques for more complicated forms of iteration like the following:
1. Iterate over rearrangements of a list.
2. Iterate over subsets of a list.
3. Iterate over all indexes of a multidimensional list.
4. Iterate over all "combinations" of a list, i.e. all subsets of a list of a given length, where subsets that differs only in their ordering occur only once total.
I recently had cause to do (1) and my method was ugly, slow, tedious, and generalized poorly, which is why I ask. I can think of better ways, but it was garbage code anyway [brute force checking that there are precisely 576 seven-digit numbers made up of 1, 2, 3, 4, 5, 6, and 7 that are also divisible by 11]. The others are just for my own curiosity.
View 4 Replies
Sep 1, 2009
Im trying to tackel a forever complicated process of comparing listviews
Imagine two listviews (listview1 & listview2) both have 4 colums.
On clicking a command button i want it to go through colum 3 of each row on both listviews ( one and two ) and see if they match, if they dont, do a msgbox of the text of colum 3 of that rows text in listview2.
View 4 Replies
Jan 1, 2010
Suppose I want to broadcast CTRL+C to my program without using complicated code (accessing Windows API) to do it.
View 3 Replies
Mar 14, 2011
I have a form populated with controls. Short of looping through every control and hiding them, is there a way I can draw something like a message over them using the form's paint event? Or would I be better off putting an actual control in the middle of the form over all the controls?
View 3 Replies
Jun 30, 2010
Finally took the plunge for wpf, all was going well until i needed to do a simple drawing on a canvas control (presume this is the right surface to use). First thing i noticed is that there is no paint event in wpf so i looked at a few others (Initialized, layout updated) at this point i looked under google and found very little on this. would anyone here have or know of a tutorial to allow this functionality? My application (a testbed) will draw an archery target within the canvas along with score numbers in the correct place as follows to do this it will need to draw several filled circles with black (or white) borders and text objects in the correct position. the locations and widths of the circles will be determined using a simple algorithm so my question is on the structure of paint events within wpf, are the commands the same as in gdi+?
View 3 Replies
Sep 28, 2010
I currently have a application that takes a image of the selected area that is set by the user.
I now would like to draw a black box in the section of a image
Top left
7, 458
Bottom right
512, 472
I would like that area filled up with a black box.
View 4 Replies
Dec 22, 2010
In the project I am translating from vb6 to vb.net, one of the key features is in drawing various graphics like lines, circles, arcs, rectangles, etc in a Picture Box control. From what I have run into, there seems to be at least two different approaches, using WPF and GDI.
View 2 Replies
Jun 8, 2010
i have used this code in Vb6 to color the background and parallely added a colo selection fuctionality on right click.Now i want the functionality to be working in VB.net 2010.
Me.BackColor = System.Drawing.ColorTranslator.FromOle(CInt(colorCode))
View 1 Replies
Mar 13, 2012
I've problem with clearing the drawing in PictureBox. The parts of a drawing are created with PictureBox1_ Paint Event like this: Name is one of the Subs (just part of a drawing). I've created a second event Timer1_Tick in which I want to clear the drawing created before but I can't reach it just with g.Clear(Color.White).
View 8 Replies
May 13, 2012
I'm trying to draw some kind of circle diagram. Input data are only two integers: "a" (even or odd) and "b" (even). Here is the
HTML Imports System.Drawing.Drawing2D
Public Class Form1
Dim P As New Pen(Brushes.Red, 1)
Dim a As Integer = 24
Dim b As Integer = 2
Dim Angle As Single = b / a * Math.PI
[Code]...
View 2 Replies
Jan 18, 2012
I have been working on an angle calculating program. I have incorprated a feature so you can type the angle and the program draw it. I have since added a few new features and updated everything as such. For the life of me I can't figure out why the draw angle has stoped working. let me just paste some code.
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
[Code]....
Right, the program isn't so complicated. The important bit is that you type an angle in textbox1 and hit enter. Then what happens is the angle is calculated against a base line (one of the new features is that this base line can be moved from left to right and center.) the problem occurs when you hit enter, the program doesnt actually draw the line for you.
View 2 Replies
Jul 20, 2011
I have 4 control 3 button and 1 picturebox
vb.net
Private sub Button1 Dim bm As Bitmap = New Bitmap("D:Trening4 - Copy.bmp"
[code].....
View 4 Replies
Jan 23, 2011
I am trying to make a drawing program that you can draw floor plans and the like with vb .net 2010.I know how to use gdi but I need to know how to draw lines that are scaled in inches and feet.Can anyone out there help me out with this problem?I have tried the dpi x and y but it only gives me the resolution which is 96 dpi.
View 3 Replies
Feb 17, 2011
Is it possible to draw text on a Graphics object that inverts what it's drawn on?
View 2 Replies
Oct 18, 2010
My goal is actually very simple: I simply want a (shared) function that accepts a List(Of String) which creates an image and writes those strings (line by line) onto the image. There's a bit more to it than that, but for the sake of example this is all you need to know.Usually when drawing on an image I would create a Bitmap object and get the graphics object from Graphics.FromImage:
Dim bmp As New Bitmap(100, 100)
Using g As Graphics = Graphics.FromImage(bmp)
g.FillRectangle(...)
[code]....
Seems easy enough, but the problem is that I don't know how many strings there will be in the list, nor how long they will be. The image should 'scale itself' according to the strings in the list. If the list contains 5 strings it should be 5 strings high (plus a little extra for borders). If the list contains only 1 string it should be only one string high. Same goes for the width, if the longest string is 150 pixels, the image needs to be at least 150 pixels (160, 170 or something).
This is all good, I can get the dimensions of the strings by using Graphics.MeasureString. The problem now is that I need the dimensions of the image to create the bitmap. I need the Graphics object to get the dimensions. But, I need the bitmap to get the Graphics object I'm stuck in a loop here, if I don't have the Graphics object (I can't create it from nothing..) then I cannot measure the strings, but if I cannot measure the strings then I cannot determine how large my image will be, so I cannot create a bitmap and associated Graphics object...
View 5 Replies
Jun 4, 2011
I'm trying to save the lines I drew in a PictureBox as a bitmap, but it just returns blank images...This is the code I have now:
vb
'Draw a grid on PictureBox named draw
For x As Integer = 0 To bWidth
[code]....
View 3 Replies
Feb 15, 2011
Okay, I'm making a fresh start and re-exploring my options. I'm trying to put a layer of transparency over a program that will act as a drawing layer. The cursor should be able to sniff to see whether it's sitting on transparency, or a drawn object. Transparency it will click through, while clicking on a drawn object will enable the user to edit said drawn object.
I've been trying to do this using a user control I made from scratch, but this is starting to look more and more like a dead end the deeper I get into it. Currently the layer of transparency works, along with the cursor sniffing, but the user control refuses to be brought to the front.
Any ideas on other ways to go about this / ways to make the user control work?
View 6 Replies