Search:

Type: Posts; User: Bulldog

Page 1 of 13 1 2 3 4

Search: Search took 0.14 seconds.

  1. Replies
    1
    Views
    633

    VS 2015 Count shapes in image

    I have an image which has a number of shapes, all are the same color and on a white background. Is there a quick way of counting how many shapes there are?

    I don't want to know what shape they...
  2. 5.0 Re: Read PNG 16 bit greyscale file pixels

    I found a solution which I shall put here for posterity...

    Download FreeImage from freeimage.sourceforge.net/download.html, compile the DLL for .Net and after adding a reference to it, you can...
  3. 5.0 [RESOLVED] Read PNG 16 bit greyscale file pixels

    I have a PNG file which is a greyscale image and I want to do calculations on the data within it. I don't need to display it, I just need to get at the pixel data and assemble a 2D array of the 16...
  4. Replies
    3
    Views
    1,525

    Array indices, change the element order?

    If I have a function that accepts an array as a parameter, e.g.

    double DoStuff(int arr[])

    Are there any ways of specifiying the indices of that array to effect a change in the array element...
  5. Replies
    9
    Views
    2,419

    Re: WPF vs WinForms

    The move to Python is motivated by platform independence. Since performance is an issue, a Linux platform may be better for some users and Windows for others. Python is not a replacement or even an...
  6. Replies
    9
    Views
    2,419

    Re: WPF vs WinForms

    I just finished a very large app using WPF and it was, to be honest, something of a nightmare. It was my first time into WPF and also the first time in my career I didn't enjoy programming. I work in...
  7. Replies
    4
    Views
    12,399

    Re: ListView Background Color

    I got to the bottom of this and for posterity the solution is;

    Assuming MyCollection has a member "Color", create an additional string member such as MyCollection.KnownColor and set it to...
  8. Replies
    4
    Views
    12,399

    Re: ListView Background Color

    <TextBlock Text="{Binding MyColor}" Width="80" >
    <TextBlock.Background>
    <SolidColorBrush Color="{Binding MyColor}" />
    </TextBlock.Background>
    </TextBlock>


    This also doesn't...
  9. Replies
    4
    Views
    12,399

    ListView Background Color

    I have a ListView where one element of the Collection is a color and the element is called "ItemColor" (of type Color). I want to set a given ListViewItem to be that color.

    No matter what I try, I...
  10. Replies
    3
    Views
    4,429

    Re: C# Console List Selector

    A console has no KeyPress handler, so you have to simulate that usig something like;



    ConsoleKeyInfo MyKeyInfo;
    do
    {
    MyKeyInfo= Console.ReadKey();
    ...
  11. Replies
    4
    Views
    990

    Re: Highlighting textbox

    It works for me, but the text will only show as Selected while the TextBox has focus. So you might be better off highlighting using Bold text for example or perhaps changing the text Color.



    ...
  12. VS 2010 Re: Enabling WebBrowser disables Form.KeyDown events

    The WebBrowser control has no KeyDown but it does have PreviewKeyDown, so if the WebBrowser has focus and you press a key it will raise that event as below;




    Private Sub Form1_Load(sender...
  13. Replies
    4
    Views
    990

    Re: Highlighting textbox

    To show it as selected, you would need;



    TextBox1.Text = "Hello"
    TextBox1.SelectAll()


    To clear the text, you can use TextBox1.Clear()
  14. VS 2013 Re: Problem Detecting Greater Than or Less Than

    What 'type' is HumanPlayersCard? Is it an array? or is it a string? (in which case HumanPlayersCard(0) is only the left letter/digit).
  15. Replies
    9
    Views
    3,626

    VS 2013 Re: listbox line height

    According to MSDN, the ItemHeight allows adjustment https://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.itemheight(v=vs.110).aspx
  16. Replies
    13
    Views
    2,588

    Re: My.Resource..Save Causes GDI+ Error

    Is the file in use?, perhaps it's locked.

    Try this


    Dim B As New Bitmap(My.Resource.<bitmap name>)
    B.Save("FileName", System.Drawing.Imaging.ImageFormat.Png)
  17. Replies
    3
    Views
    890

    Re: Chart Tools

    Add;


    Chart1.Series.Clear()
    Chart1.Legends.Clear()
  18. Replies
    10
    Views
    13,716

    VS 2010 Re: Fastest way to compare two datatables?

    I've used the CompareDataTables in this post and it seems fast, but then again I only have small'ish tables (32x20)....
  19. Replies
    3
    Views
    890

    Re: Chart Tools

    Can you post the code?
  20. Replies
    2
    Views
    755

    Re: ability to enter . and cents into textbox

    You can use a NumericUpDown control and set decimal places to two. You then nudge it up/down with the arrows or just type in the number.
  21. Replies
    24
    Views
    13,511

    Re: Regex Help

    Well... my interpretation is below. I tested this on quite a few examples (but I'm not sure it's 100% correct, so code read it and check it for yourself).

    I'm sure this could be cut down but...
  22. Replies
    24
    Views
    13,511

    Re: Regex Help

    It depends on the engine, the VB.Net Regex engine is different to other implementations. I'll have a think about this, now I can see how it works, I can decompose it and reconstruct it.
  23. Replies
    24
    Views
    13,511

    Re: Regex Help

    I know a lot about regex but this one has me stumped. But I think I see how this works and it doesn't do what I thought, it's not looking for words.

    It starts an index of zero and looks for...
  24. Replies
    24
    Views
    13,511

    Re: Regex Help

    I'm not sure how that regex is working but the equivalent function appears to be this;



    Public Class Form1

    Dim Words As New List(Of String)
    Dim Occurrence As New List(Of Integer)
    ...
  25. Re: Count the number of characters after a certain number of characters

    Dim str As String = "ABCDEFGHIJKLMNOP"
    MessageBox.Show((str.Length - (str.IndexOf("G") + 1)).ToString)
  26. Re: FTP vs Shared Folders - Is it worth the effort?

    Windows has the infrastructure to create a network, so I would be inclined to use that. You can also create a network drive which becomes a mapped drive to each minion. Putting a folder there with...
  27. VS 2010 Re: CaptureControl CopyFromScreen is reducing the original image width and height

    I'm guessing that your PictureBox is 474x367.

    If you load a picture (e.g. 320x200) into a PictureBox it will scale to fit into the PictureBox size (depending on the SizeMode property). If you save...
  28. Replies
    8
    Views
    2,197

    Re: Help with Graphics And timer game! THANKS

    Then set x and y to the position it's supposed to start from.
  29. Replies
    8
    Views
    2,197

    Re: Help with Graphics And timer game! THANKS

    Firstly you should be drawing graphics in the Paint method of the form, not the click method of the button. To raise the Paint event, you call the Invalidate method.

    You're currently drawing a...
  30. VS 2012 Re: Disabling Home.End keys on TrackBar control

    Does this work?, maybe you already do this;



    Private Sub TrackBar1_KeyDown(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) _
    Handles TrackBar1.KeyDown
    ...
  31. Replies
    1
    Views
    608

    VS 2010 Re: Numeric Up down control.

    That's a weird requirement but perhaps something like this;



    Dim NumericUpDown1ExistingValue As Integer
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles...
  32. VS 2012 Re: Object reference not set to an instance of an object.

    What is the value of instance supposed to be? What value is "count" when this occurs?

    In your "New" button you have;


    Dim instance As New TheStuff

    which will create "instance" but local to...
  33. Re: Detect if a mouse click is performed on a control inside TableLayoutPanel

    Not that I know of, but you can detect a click in a few lines of code;



    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) _
    Handles MyBase.Load
    For Each ctl As...
  34. Re: Back in the saddle - intro + discussion...

    A Class is like a re-usable component, it represents an 'object' or 'type'. You can create multiple instantiations of Classes i.e. create objects that exist together but are independent of each...
  35. Re: Help on getting file path with get command line args

    ok, so you have files with extension .ham and you have associated your application with that extension, so when you double click a ham file, it starts your program. When your program opens, you want...
  36. VS 2012 Re: TableLayoutPanel, add PictureBox, display selected Cell ?

    If you're TLP extends beyond the visible area, that code will not work since it relies on the mouse position. You would need to adjust the position based on the amount of scrollbar movement.
    ...
  37. Re: Help on getting file path with get command line args

    The file path of what?, the application?, the current directory?, an input file?
  38. VS 2012 Re: TableLayoutPanel, add PictureBox, display selected Cell ?

    If you have PictureBox controls in the TLP, why not use events associated with those PictureBoxes to identify which you are over/clicking etc? A PictureBox has a set of events associated with it and...
  39. Replies
    3
    Views
    3,978

    VS 2013 Re: Spell CHeck Richtextbox

    I did a quick google which turned up this very nice CodeBank submission from i00;
    ...
  40. Replies
    3
    Views
    3,978

    VS 2013 Re: Spell CHeck Richtextbox

    That code is looks like it's adapted from VB6, it's littered with 'old' statements and I can see a lot of coding errors. The worst is that there are Try/Catch statements that have no corresponding...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width