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





See Related Forum Messages: Follow the Links Below to View Complete Thread

VB6 Split One Picture Into Multiple Picture Boxes.
how do i open a bmp or jpeg image into two seperate pictureboxes on the form? eg. half the picture in one box and half in the other? it should be quite simple but i can't find it out.
whatever method is used to do this, can it also be used to split the picture up more? eg. split into vertical quarters and put this into 4 pictureboxes?

Image Boxes And Picture Boxes
hi, when i use this coding for and 'ImageBox', it works, but when i use it for a 'PictureBox', it doesnt. Can someone please tell me why.

Private Sub Timer4_Timer()
Picture1.ZOrder (0)
Picture1.Move Picture1.Left, Picture1.Top - 40
Picture1.Move Picture1.Left + 20
End Sub

when 'Picture1' is replaced with an Image1, it works, but if i leave it at picture box, it doesnt. Someone please help

here is the coding that executes Timer4...

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If Asc(32) Then
Timer4.Enabled = True
End If
End Sub

is that 'Asc(32)' (which is the space bar) cannot move picture boxes but it can move imageboxes?

someone plz help

thank you

Picture Boxes And Image Boxes
What is the difference?

Picture Boxes And Image Boxes
What's the difference between a picture box and a image box?

Test If The Picture In Two Picture Boxes Is The Same?
Is there a way to test if 2 picture boxes are equal to each other?

Ive got 2 pictureboxes.
PicCapture
PicToMatch

I have loaded in the Pic to match the picture that I want to test of picCapture is equal to. The PicCapture takes a little portion of a screen shot and then AND's a mask on top of it. Then i need to test if the 2 pictures are equal.

I know they are equal, but PicCapture.picture=PicToMatch.picture always returns false.

How can this trick be accomplished?

Thanks in advance!
Nugget

Picture Boxes
I would like to know how to create new pictureboxes only using code.

Do I say

Dim Mypicture as PictureBox

Public Sub init()

Mypicture = new PictureBox

End Sub

I am not sure how to make a new picture box with just using code. Please help me.
I am using Visual Basic 6.0.

Picture Boxes
Hey I am using a control array of picture boxes indexed from 1 - 12 and corresponding to the number a different picutre is shown from the value of an array. I want to be able to click any two of the boxes and on the second click for a msgbox to appear with "try again'

[ vb/ ]
Private Sub Command2_Click()

Dim i2, lnArray() As Long

RandomArray2 lnArray, 12, 1

For i2 = LBound(lnArray) To UBound(lnArray)
Label2(i2).Caption = lnArray(i2)
Next i2

For i2 = 1 To 12
b(i2) = Val(Label2(i2).Caption)
Label2(i2).Caption = b(i2)
Next i2

End Sub

[ vb/ ]

Private Sub Picture2_Click(Index As Integer)

Select Case Index

Case 1 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 2 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 3 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 4 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 5 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 6 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 7 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 8 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 9 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 10 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 11 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture
Case 12 'first picbox selected'
Picture2(Index) = memory_pics.Pic1(b(Index)).Picture

End select

Endsub

ive tried to use a counter in the procedure so when counter = 2 the msgbox appears but i cant get it to work for all 12 of the pictureboxes

Any help would be appreciated, thanx

Picture Boxes
I have 5 pieces of data being stored in a picture box
Any ways to align this data show it can be read easily by the reader.

Cheers

Picture Boxes
I have 9 picture boxes in a control array, Pic1. How would I make my program load a picture into a random box, but only one that is empty (no picture in it) ?

Picture Boxes
I have a form with 9 picture boxes. The names are Pic1 Pic2 and continue to Pic9. What do I do to make it load a picture into a random picture box but only load into one that is empty?

Picture Boxes - Please Help
Does anyone know how to show data being entered into a picture box, say after 40 lines have been added???

Picture Boxes
How do I make it so that if you click on a picture box it opens up a thing (like run) that lets you choose what image you put in it?

also, reply to my thread below this (a4)

be specific

Picture Boxes?
i have been doin vb for about 3 months and i have just wondered how to print in a picture box. ie

m = text1.text
picture1.print m
(this is not valid code!)
i don' know how to do this?

Picture Boxes
I think this is a simple question with a hopfuly simple answer.

Is it possible to select text inside a picturebox or is it being displayed as a picture. If it is possible, how can i do it?

Thanks a lot

Ian

Help With Picture Boxes?
I have a chess program...i want it so that when i click on a piece, it will go through an If statement and determine which type of piece it is that was clicked on, but im having some problems. Here is what i have so far inside of my function

If Square.Picture = ("Z:Pawn.bmp") Then
MovePawn()
ElseIf Square.picture = ("Z:Rook.bmp") Then
MoveRook()
ElseIf ....

I think you can get the picture of what im trying to do...but the problem is that when i run the program, i get a

Run-Time error '13':
Type Mismatch

When i hit the debug button it highlights the line of the if statement that says

If Square.Picture = ("Z:Pawn.bmp") Then


I have no idea what is wrong. With my logic, it seems like it should work...any ideas?

Picture Boxes!!!
i have two forms, m using the first one for getting the number of picture boxes from user, and then i want to display the picture boxes on next form.
suppose if user provide me 2, then 2 picture boxes should be displayed in the next form.
how can i do it plz tell me???

Picture Boxes
ok how do you make a picture inside of a picture box, that is bigger than the box, move over so that you can see some more of it. Like on a scrolling map.

Picture Boxes
I was wondering what the FASTEST way to paint one image into a picturebox

such as you can use Picture1.paintpicture <blah>
to paint one image at a certain position..

well: what is the FASTEST way?
if it is Bitblt could someone paste the code to do it..?
Thanks alot

[BTW: I need to copy an image from IMAGE LIST to the picture box]

Picture Boxes
Hi

When i try to change the picture in a picture box at run time, with the following line:

picturebox1.picture = "C:My WorkAlexStoner.bmp"

I get a type mismatch on the
"C:My WorkAlexStoner.bmp" section.

Can anyone help?

Need Help With Picture Boxes
Hello,
I am pretty good with VB but this one has me stumped. Here is what I am trying to do. I have a text box at the top of the form and a picture box at the bottom. Right now I have the code set up so that when I type the word "Bus" for example in the text box, a picture of a small bus appears in the picture box. Unfortunaly, I can only display one picture at a time. However, I would like to be able to display several pictures at a time but am not sure how. Could someone please tell me how I should go about doing this.
Thank you in Advance,
Jon_V

Picture Boxes.
Why is it that everytime i have a dialog box over a picture box, it deletes
the images inside of it?
how do i prevent this from happening?

Picture Boxes
How can I make the background of a picture transparent?

Thanks in advance

Picture Boxes
Hi,
I have two picture boxes, and I would like some sort of event to occur when the picture boxes touch each other. What code would you type? Here is what I tried....


Dim score as interger

If Piccone.Top = picH Then
score = score + 5
end if
lblins.caption=score

Thanks (in advance)

Transparent Picture Boxes
Just making the final adjustments now... at the moment I have a "charting" display for the sky. Basically there is a square viewport which is a normal picture box. The stars are drawn onto this "bottom" box. There are two more boxes which sit "on top" of this one - one which contains the stars' names and another on which a grid is drawn. See the little diagram below for clarity.

| >>>>> | >>>>> | >>>>>> | >>>>>> |

screen "stars" box "names" box "grid" box user

These are transparent picture boxes, which are dedicated objects created by another VB programmer in Denmark. The idea is that the user can choose to see or hide either (or both) of the "names" or "grid" boxes.
Everything works very well - apart from what appears to be a bug somewhere. On certain rare occasions - seemingly when there is a lot of detail to be shown - the display doesn't work properly! Usually what will happen is that one of the boxes refuses to show. That is, you may be able to see the box containing the stars' names, but not the stars themselves!

The bottom line is, can I do this without using his control? I need to be able to show or hide each of the boxes except the "bottom" one with the stars on. That's always visible. I understand that there are ways to do this using the API functions, and I think it will be made easier by the fact that all of these picture boxes are stationary. In fact they have to be!
Can anyone advise? Thanks.

Transparent Picture Boxes
In my game when the user moves his object over terrain the whole terrain picture box goes gray like the background of the figures one. Only the figures picture is shown because the pic box isnt transparent! The picture of the figure IS TRANSARENT!

How can I make the box transparent, the option fillstile: transparent wont work!?

Scrolling In Picture Boxes
here's the deal, I'm working on a map editor and I'm blitting the selected tiles to a picturebox. But if I need a huge map, I'll need the picturebox to scroll. So would I do that?

One More Thing (regarding Picture Boxes)...
is there any way you can make a picture inside a picture box stretch to fit the picture box at design time without all that code? if so, how?

Pictures In Picture Boxes
I am trying to make a macro to make the insertion of small icon images into a document easier.
If you can imagine one picture (bmp) containing all the little images, my question is how I can copy just one of these images to the clipboard through Word - i.e. through a macro.

So far, I have a small form which displays the big picture in a picture box. As the user waves the mouse over the picture, a highlight square indicates which image will be inserted. This is far as I have got.
I now need to actually grab that specific part of the picture and stick it on the clipboard.

Its a bit of a strange one I know, but the alternative is having to load up paint, zoom in (they are quite small pictures) and carefully cut out the picture I want. A single click in a picture box is a much more elegant solution.

Add/remove Picture Boxes On The Fly
I'm doing a little personal development in my spare time and I just realized that I have never attempted to create objects dynamically. I'm hoping that it's possible...

In my app, I want to be able to create copies of picture boxes on the fly. In design-time, I have two picture boxes. They're in an array. What I would like to happen is, during run-time, create a copy of one of the two boxes and add it to the array. I would also like to be able to remove this new box. It will never be in the middle of the array, rather I will add/remove to/from the end of the array.

Is this possible? Can anyone point me in the right direction?

Combo And Picture Boxes
Yet again, I have hit another problem. I have a combo box (that lists names of cards i.e. A, 2, 3, ...K) What I need to do is this:
When you select a card name from the combo box, it's picture shows in the picture box. The pictures are on my local drive so I will need to path to them right? If there is an easier way to do this, please let me know. I'm not familiar with Combo boxes and Picture boxes together like this so I have almost NO clue what I'm doing. Any help is appreciated.

Thanks in advance!

Print Picture Boxes
hi, i'm trying to print several picture boxes in one sheet, one by one, i use the printer.paintpicture method for each one, and when i use endDoc it goes to the printer but never come out.

thanx

Image/Picture Boxes
Hey is there a way in VB to keep the background out of the picture box. Like i want to use a picture of a person, but it comes with a background that doesn't look right. Is there a way to fix that.

Displaying Picture Boxes 1 After The Other
Hi ,
I have tried to do an animation with showing and hiding picture boxes.
When i cycle through them manually they are fine
when i use a timer between boxes all i get is a grey empty picture box

here is code


Private Sub Com_Click()
Dim time As Long
time = Timer

Do
pic1.Visible = True
Loop Until Timer > time + 3#
pic1.Visible = False

Do
pic2.Visible = True
Loop Until Timer > time + 6#
pic2.Visible = False

Do
pic3.Visible = True
Loop Until Timer > time + 9#
pic3.Visible = False

Do
pic4.Visible = True
Loop Until Timer > time + 12#
pic4.Visible = False

Do
pic5.Visible = True
Loop Until Timer > time + 15#
pic5.Visible = False

Do
Pic6.Visible = True
Loop Until Timer > time + 18#
Pic6.Visible = False

Do
Pic7.Visible = True
Loop Until Timer > time + 21#
Pic7.Visible = False

Do
Pic8.Visible = True
Loop Until Timer > time + 24#
Pic8.Visible = False

Do
Pic9.Visible = True
Loop Until Timer > time + 27#
Pic9.Visible = False

Although theres plenty duplication here i will put into an array once i get the thing working
thats easy part just cant get my pic bixes to display , i have tried seeting autodraw to True and false with no joy.

Im missing somthing ( apart from Brain cells) but what

billy

Removing Picture Boxes
I have an array of picture boxes with object in them the user can remove object from the picture boxes. I would like to be able to unload the picture box automatically when the user has removed all objects. In other words is it possible to know how many object are in a picture box.

Saving Picture Boxes
How do I save my picture boxes image? I want the save window to pop up. I read the Command Diloge TUT and I didn't get it?

Help Wtih Picture Boxes
Can anyone tell me how can I put an image inside a picture box?

Printing Picture Boxes.
How can I print a picture box and all of its contents, if anyone could help me it would be really great
Viperchief

Animation With Picture Boxes
I have 7 picture boxes on my form, they are in a control array called 'spin'

I need to animate them in another picture box...

Thanks

Moveable Picture Boxes
Hey

i have been looking around and struggling to find what i want.

i currently have one big picture box with 5 small picture boxes within, i want it so i am able to move these small boxes around when i click and drag and then drop.

how do i do this?

thanks
lee

[Resovled]Picture Box That You Put Boxes Into???
I have a picturebox, I can load an image into it but after I do, I want to be able to make rectangle's on it like ms paint, and the use a code that tells you where the corner is on the x and y, with your size of the box, x and y???? I have a code that tells you corner location and image size but dont know how to make rectangles in a picturebox and apply the code I have to tell you position????? (All in pixel's, have scaler code already)
If you have any questions, post back

Printing Picture Boxes
I need to know how to print a picturebox or an area of a picturebox in vb6>

Handling Picture Boxes
the problem i face is with picture boxes

when i load an image into a picturebox and if the image is bigger than the picture box the picturebox doesnot consider the entire image.

For example
I tried to load an image from a file into the picturebox and then from that pictuebox i plotted the image into a new picturebox pixel by pixel and saved the result.

But the result i got from the saved image was not the complete image.
Let me attach the code for ur better understanding

VBCODE
-----------------------------
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crcolor As Long) As Long



Private Sub Command1_Click()
Me.Picture1.AutoRedraw = True
Me.Picture1.AutoSize = True
Me.Picture1.Picture = LoadPicture("c:img.jpg")
End Sub



Private Sub Command1_Click()
Me.Picture1.AutoRedraw = True
Me.Picture2.AutoSize = True
Me.Picture2.AutoRedraw = True
Me.Picture1.AutoSize = True

Me.Picture1.Picture = LoadPicture("c:img.jpg")
Dim x, y As Integer
x = y = 0
For y = 0 To Me.Picture1.ScaleHeight - 1
For x = 0 To Me.Picture1.ScaleWidth - 1
Call SetPixelV(Me.Picture2.hdc, x, y, GetPixel(Me.Picture1.hdc, x, y))
DoEvents
Next
Next
MsgBox ("")
SavePicture Me.Picture2.Picture, "c: est.jpg"
End Sub

Don't forget to load two pictureboxes named Picture1 and Picture2

Moving Picture Boxes
I am making a soccer shoot-out game and i want to move the soccerball (the Picture Box) to where the player selects eg. top right, top left, top centre, bottom right, bottom left, bottom centre. If someone could please help me with this code it would be much appreciated

Transparent Picture Boxes?
I have made a transparent Icon file, the idea is it is shown Transparent where supposed to be inside my picture box, on the form. However it shows my icon in the pic box, but with a colored square around it. See attached screenie:

Anyway, i want to make the picture box transparent (removing the white square around my Icon)

Property Bag And Picture Boxes
i know how to read from a picture box and read the info to a property bag but how do i put info from a propertybag to a picturebox again?

Drawing In Picture Boxes
i dont know any API..nor to much VB...but i made a SIMPLE program that allows the user to draw in a picturebox, sorta fun!


Code:
If T = "draw" Then
If Button = 1 Then
Picture1.Line (X, Y)-((X + 25), (Y + 25))
End If
End If


used that code in the picture1_mousemove to draw little dots as the mouse moves, like the pencil tool in MSpaint. but if i move the mouse to fast, the dots are really seperated.
is there any ez way to make it so the dots aren't so seperated if i move the mouse around faster? w/o using to complicated code..

Can Picture Boxes Move?
I m making a module puzzle game. How can I get the puzzle pieces to move can I use picture boxes?

BitBlt And Picture Boxes
I'm using BitBlt to copy an area of the screen to a picture box, and want to be able to save this. The problem I'm getting is that SavePicture saves whatever was in the picture box before it was blitted, and if you minimize the form, when you bring it back the blitted information is gone does anyone know how to fix this?

Mci Control And Picture Boxes
Hi...

I want to play a video with a multimedia control.

I use this code to open a video:

MMControl1.DeviceType = "avivideo"
MMControl1.hWndDisplay = Picture1.hWnd
MMControl1.FileName = fileStr
MMControl1.Command = "open"
MMControl1.Command = "back"

where fileStr is the name of the file and picture1 is a picturebox

I have to draw some rectangles over the video so I want to play the video in a picturebox that isn't visible, then I copy the image into a visible picturebox and I draw my shapes...
This isn't working at the copy operation.
I tried to change the autoredraw property but this is the same...

Can you help me?

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