I am just wondering how i can create a picturebox array like i could when i copied and pasted another picturebox in VB6 and it asked me if i want to add them to an array. Doing so made them code like this:
I am required to make a game of concentration, whereby cards are shown for x amount of seconds and then truned over. The user then needs to remember where the cards were and pick two at a time in order to win points - whilst being timed.
Any pointers on where to start, or how to make a 2D control array of pictureboxes that can display the cards into a grid of (10x10) pictureboxes randomly?
I'm attempting to create multiple PictureBox controls. This is as close as I've got this thing to work:
vb.net Dim Obj(6) As PictureBox, i As Byte Dim Pics() As Image = New Image() { _
[code]....
However, it gives me this error on run-time:
Quote:
Object reference not set to an instance of an object. on the line "Obj(i).Image = Pics(i)".It would work if I was able to create a 'new' instance: Dim Obj(6) As New PictureBox, however apperntly:
Quote:
Arrays cannot be declared with 'New'.I am pretty sure that my image resource files are 'instances' of objects'' because the code works fine when every statement is written out separately (no arrays).
I have a Picturebox, where the .Tag property is holding a path to a file. But I would also like to have something like a .Tag2 property that could hold another file... I'm guessing this is possible to achive, but I have been struggling with this for quite some time now, and I really don't how I to do this... I can't seem to any useful information on the net either...
I'm trying to create a small game in VB2010. The gameplay is as follows:
civilians would walk/stand in a room/street and suddenly an evil character would pop from the ground/wall. This evil character would suddenly vanishes too. So, the player has to shoot it to kill the character. The evil character, civilians, etc. would be random. Also, there would be sound effects too. That is the popping up of the evil character, it's voice, the civilians voice, etc. I'm trying to make it as simple as possible but without degrading the quality of the game play. I think, I could somewhat create the graphics for the characters, scenes, etc. and can get the sound effects recorded.
So, the difficult part is,[ ] how could I make it a smoother for playing the game ? [ ] what would be the best way to do animations ? [ ] Creating a GIF and placing it in the picturebox and moving it ? [x]how to play the music in background and at the same time play sound effects on certain instance ?
I am working on a small desktop form in VB 2010 and am trying to place a pictureBox with an image in it, next to another pictureBox already located on the form when the user clicks a button.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim tool As String
[Code]....
But for some reason the newPictureBox with image from "ptext" does not show up on the form. When I specify the new Point to be something like, (50,50) instead of getting the first pictureBox coordinates, the new pictureBox shows up in the right place.
Am I using System.Drawing.Point wrong? Or is there some other error that I'm making?
I have an array of people stored in a custom structure array... how can i copy this array to a temp array so that the temp array has all the same values as the original custom array?
In my code i used a button to create a picturebox & it can move. I want to avoid overlapping of any pictureboxes created in the form.i used timer for it but i am having a trouble to avoid overlapping & i cant apply array in the intersectwith().
In the beging of the project I am entering this code.
Dim pic0 To 30000) As PictureBox
Then in the project I change the images for some pic(i). So now I would like to make a click event so when they click on a pic(turebox) it will change its border. (eg
editing a picturebox...i have a class called panelArray and it builds an array of panels based on the number of panels i pass it...each panel has 4 labels and a picturebox added to it when the panel is created. I'm able to edit the labels by using something like:
Since there are 5 objects total (1 picturebox & 4 labels) i thought i would be able to just use the same strategy for the picturebox, but it doesn't like using Image in the same manner it uses .Text?
Basically I'm trying to make a picturebox array so to speak and at the momment I'm currently linking each picturebox one by one with the corresponding array row/column. Seen below.
I have recently decided to move on from VB6 and upgrade a program I made in it to vb.NET.
I have a form that looks like this
If you look I have 4 picture boxes coloured and a text box next to each of them
What I want is when you change a colour of the text box it changes the text in the text box next to it to the web code like #000000.
My code so far is [URL]
vb Public Class frmSettings ' Public ReadOnly PictureBox As New List(Of PictureBox)() Dim groupPB() As PictureBox = New PictureBox() {Me.cs1, Me.cs2, Me.cs3, Me.cs4} Dim groupTB() As TextBox = New TextBox() {Me.txtCl1, Me.txtCl3, Me.txtCl3,
I have some BLOB images within a small, 9 row, database and I simply want to run through the database and sequentially place each separate image into 9 picture boxes. I have tried with a picturebox array but it's placing the same image into each picturebox!
This was an experiment to see if I could create a fake array using generics instead of using an array. I decided to try it, because I may use it if I find any advantages to using it over an array. it works, I am just asking for a second or third opinion, have I screwed anything up, or is there an easier way to accomplish this? If I use it, it will be for a 2D game I am creating, and is used to draw the 2D screen graphics, placing an image based on what image identifier is located at what coordinates. The value stored in the fake array is an integer that disignates the graphic to draw and whether it is passible or not, i.e. 0 = a floor image, 501 = a wall image that is impassible (any image number > 500 is impassable) The Class definition:
I would like to do that. Find the board on-screen that convert it to Color Grid on a picture. I have tested few things but they did not work. It randomly draws white and greyish squares instead I would like it to create what it reads off the screen.
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint Dim img As New Bitmap(PictureBox1.Width, PictureBox1.Height) Dim gr As Graphics = Graphics.FromImage(img) gr.Clear(Color.White) [Code] .....
I'm trying to use the code here [URL]. To create a zoomable pic box but is it possible if I could create a 'control' from it that I would then be able to drop onto the windows form.
I'm filling a FlowLayoutPanel with an array picturebox that depends of the number of files in a selected folder. The problem is that images appear stretched, and I want to keep the aspect ratio. Resizeimage is the resizing rutine and works fine. The clicked image wil be shown in a picturebox with a new sise (bigger).
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown Dim pb As New PictureBox pb.Location = e.Location[code]....
It does that you click on something in the form then it will create a Picturebox.Okay what I want more is this:
1. It should only can be made one picture box every 32x32 like this:
If you dont know what I mean then just forgot it but please try.
2. When I right click on the mouse the Picturebox should be deleted.
I'm using this snippet to create a blank image in a picturebox, but is it possible to have the image coloured so that I can see it. (I'll need to colour it later anyway).
.Image = New Bitmap(newPictureBox.Width, newPictureBox.Height) 'blank image.
Also if it is possible, I intend to draw lines, rectangles on the image (hopefully) and save the lot, so would I lose the colour, or would it get saved, or does it depend on what it gets saved as?
I'm creating an app for school to mark targets that we shoot in shooting competitions. Now I have created a dll in C# to do the marking bit and it works.Now the problem I am facing is that my app gets a image from the scanner (A4 size @ 600 dpi) and putting it in a picture box.There will always be 20 targets to be marked per image( However I want this to be able to vary to provide flexibility) My dll accepts a image that contains a single target so I need 20 individual images of targets.Create Drag able Rectangles in the picture box and crop the images from there . There are 2 ways of accomplishing this.
#1 Create a Control and set it's parent to the picturebox. (This should provide a location relative to the picturebox Right ?)
#2 Use only GDI (eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeew)
so my choice would be to create a control except I have never created any control from scratch and I have no idea how to do the visual drawing part of a control.
I'm trying to accomplish is having a 20x20 pixel image show up multiple times as determined by the grid selected. To keep things simple, what I'm trying to do is create a 9x9 grid of a image onto a form. I'm assuming that a picture box is the way to go, but don't know how to make that happen or if it's even possible.
So it would go something like this:
2D array already assigned: Sub ShowGrid() For rw As Short = 0 To 8
[Code].....
But instead of using a text box with values, I want to show a grid of a small image file, like cup.png which is 20x20 pixels or whatever, so what would show up on the form in this case would be a 9x9 grid of the image file over and over to create a grid.
Then the next step I hope to accomplish is to have that 20x20 square picture hold the grid(x,y) value for a mouse click. So if the image at grid(3,5) is clicked, it will give me that value, 3-5.