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




Picture Boxes And Image Boxes


What is the difference?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
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's the difference between a picture box and a image box?

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.

Image Controls And Picture Boxes
Hi,

This is probably a bad and extremely novice question, but I don't know the answer . What is the difference between and image control and a picture box? What are some examples of using one for a certain situation and the other for another case?

Thanks.

- Dan

Split An Image Into 2 Picture Boxes
hi i have a image lets say
100X100 size

is there a way i can split this into 2 image boxes so it becomes
2boxes both with
50x100 size?

Image Control In Picture Boxes?
I have placed a picture box on a form and made a file
choosing menu system for a *.jeg custom viewer. I can load
the images in to the viewer. How can a person control
the images inside the picture box? Many times I will only see 1/2
or 1/4 of my image depending how big I made the picture box
durring design time. It would be nice to have come property settings
to control the image itself. If the picture box would allow scroll
bars simular to a textbox with scroll bars it would allow me
to view the whole image. If there was settings
to make the complet image fit into the picture box would be helpful.
Does anyone know if picture box has properties that I am looking for.
If not, Is there a Windows API control that might give me better
image control?
Thank you,
doug@evansville.net

Problem With A Bunch Of Image Boxes And One Picture Box
As in my previous few posts, my program uses a 32 by 32 grid of imageboxes (created at runtime). The pictures in these imageboxes is derived from 1 or 2 images layered on top of each other (this is done using CreateCompatibleDC, bitblt, and a picture box, but this is probably not relevent to my problem.)

The program loads data from a file and displays a particular image based on the byte retreived. 1024 bytes are read from the file, but somewhere around the general vicinity of byte 775 (sometimes higher) vb crashes (invalid page fault, see below). Using a special debuging technique i came up with to determine exactly which line caused the fault, I found that the line "Editor.pbxCombine.Cls" caused the crash.


Code:
VB6 caused an invalid page fault in
module <unknown> at 00de:ffffffc5.


Is there any way to prevent this crash?

I might be able to prevent the error by switching completely to image boxes. But I'm not sure how to blit an image directly to an image box without using a picturebox.

Is ther any way to blit an image directly into an imagebox?

Picture Boxes / Image Lists / Icons
I have a situation where I need to build a picture out of a collection of icons, mosaic-style.

My first attempt was to create a form that would have Visible set to True, but be positioned off-screen so user couldn't see it; this form had all the icons I would need in pictures boxes. The main form then grabbed these icons using the picture box's Image property and tried to use the API call DrawIcon(). The problem is, the call failed, even though the hDC was valid, the Image property returned something non-zero, and the position was well within limits.

Question (1a) Why did the call fail? I can only suspect that what the Image property returns is NOT an HICON as required by DrawIcon()...

My second attempt was to take this handle and use it with the API call BitBlt() instead, assuming it was an HBITMAP. Despite creating a memory DC compatible with the display (passing 0, or NULL, to CreateCompatibleDC() ), it failed when I tried to select the HBITMAP(?) into the memory DC for blitting.

Question (1b) Why did the select fail? I assume the handle was not an HBITMAP, or it was not compatible with the DC (which should not be the case, since the DC matched the display!).

Question (1c) Given a picture box with an icon as its Picture property, how can I get an HICON handle from it, if the Image property does not give it as it hinted it did?

My third attempt was to use an image list. I added all the icons to the list(s), and sure enough they show when I DrawIcon() after calling ExtractIcon on the image list entries. Great. The problem is, it is not using the colours present in the icons (which are 16 colour)! It seems to use shades of grey, but not even a proportional shade to the real colours - white comes out as black. I told it NOT to use the mask colour, and I set the mask colour to an unused colour just be sure.

Question (2) Why is it not using my colours? How can I get it to do so?


If it is of any help, I am trying to draw these on a large picture box (AutoRedraw = False). I see no Palette property, so I don't understand why colours are being messed up.

Can anyone help?

How Can I Convert Several Image Boxes To A Single Picture File And Then Print It?
i've got a project which contains several image boxes in different positions on top of another large image box (to form a diagram) and i need to be able to save them all to a picture file on my hard drive and/or print it out on paper. can anyone help?

Thanks,

Colt

Use Of Picture Boxes - JPEG Image Content, Zoom And A Design Time Query
I wish to use several large picture boxes to display diagram information which is available from JPEG files on my drive.

1. When I load one of these to the picture box, only the top left corner of the JPEG image appears in the picture box. How may I cause the whole of my JPEG image to be visible?

2. Having achieved that, if it is possible (and surely it is) is it then possible to make the picture box zoom in on a particular section of the image such that it can be examined in much greater detail?

3. Finally, I will have about ten of these large picture boxes all placed on top of each other on my form (so that they can be as large as possible). At run time this is no problem because only one at a time will have its visible property set to true, but is it possible to do something similar at design time such that the lower level picture boxes may be edited. At design time it seems that the last box I have placed on the form always stays on top, hiding those placed previously. It is agreat nuisance to have to drag aside all the later placed boxes in order to get at and work on an earlier one.

Suggestions will be gratefully received.

ca moore

Read Google Image Search Results And Show Images In Picture Boxes
hi there,

i'm a newbie in vb, so please appologize any silly questions. i searched the forum for answers already but couldn't find anything really helpful.

what i need is:
- ask google - (e.g. http://images.google.com/images?q=0671600419)
- wait for response
- parse html for 'imgurl's and
- load the first 6 images into picture boxes in a form

this is for a books collection (2000+) tool i'm writing for a friend of mine. i want to include a 'search for cover on the internet'-function to show the books cover picture ( not to judge the book, but to impress her ) and google quiet relieably returns them when searching for the books' isbn number.

so, please tell me: how can i ...
- get the html site so that i can search it for the 'imgurl' tag?
- load a picture from a url into a picture box?

any hints, links, tutorials? please help!
thanks!
bowZZer

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?

All Things In Form Text Boxes List Boxes...Saving
Is the a command thats save every thing that is changed changed in form ...all text boxes all list boxes ...everything that has changed

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
Hi,

On my demo app' I have the one form 'Form1'.

On Form1 I have a 'SSPanel1' control that I want 'Picture1' to populate the whole area of the 'SSPanel1'.

Do I need to cover the entire area of the 'SSPanel1' control with 'Picture1' and then insert another picture box as 'Picture2' to be used to tile within 'Picture1' ?

Or is there another way in which this same thing can be achieved?

Thanks for any help,

Andrew G.


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)

Can You Have Multiple Colours In Text Boxes, Or Richtext Boxes(etc)?
Is there anyway you can have each word in a text box a different colour? Like:

[RED] My Name [/RED]
[BLUE] What's up! [/BLUE]

or something similar?

I don't care if you can't do it in a text box but is there anyway to do it in any type of "text box"?

If sub classing is involved could you please point me to a tutorial?


Thanks a lot.

Web Control, List Boxes, Text Boxes, Please Help This Is Winding Me Up!
Hi guys i need some help with the webcontrol function in VB6

Part of my program needs to put listbox data from the program into a text box on the web and then click a submit button...

The list box i have has a list of multiple directories in (for the location of my files), from there i just want the program to put the top directory of the list box into a text box on the web and click a submit button on the web (its for uploading a queue of files), then after that has finished uploading, do the next directory in the list box... etc

It sounds pretty simple but i have no idea how to do it...

Thanks for any help you can give me, i will write a really good review about you and good rating etc.

Any knowledge of this would be greatly appreciated

thanks a bunch

toodle pipples

Alex

Altering The Form Of Message Boxes And Query Boxes.
I have used the standard message box (msgbox) and query box in one of my programs which will be distributed. However, the boxes look awful! How do I change their properties, such as font, text size, picture (to the left of the box), button picture, button size etc...

Hope someone can help me out!

Many thanks,

Steve.

Image Boxes
ok after this question, call me a newbie all you want...
in the coding, how to change the pciture inside an image box?
i know it starts of by:
(assuming the 'ImageBox' is called 'Image1
Image1.Picture = ???

assuming that my picture is called 'Picture1', how would the coding go?
i know its not Image1.Picture = Picture1

ty

Image Boxes
Lets say you have 2 image boxes. One to the left of the form and one to the right. The one to the left has a picture of a red car and the one to the right is a blank image. What would be the code so that when you click on the the red car, that image goes and transfers to the right image box. so now there would be the same picture in both boxes. if you can help me with that thanks alot.

Image Boxes
Hey,
Is it possible to have three different images coming from the same image box at different times depending if you have clicked the option button which has the picture?

Thanks.

Image Boxes
is it possible to detect when the mouse has left an image box and then tell it to perform something... in this case it would be to load a picture.

Image Boxes
How do you make the image in an image box change in code.

I have:

Code:
Private Sub Form_Load()
Image1.Picture = "C:Documents and SettingsAdministratorDesktopUnityUnityGamesMansion MakerGrandPiano.gif"
End Sub


But it doesnt work

Image Boxes
to load an image to an image box u use


PHP Code:




imgnextquestion.Picture = LoadPicture("C:WindowsButton - Next Question.gif"







but i need to identify the image in the box so
if i use

Code:
If imgnextquestion.Picture = LoadPicture("C:WindowsButton - Next Question.gif" then
msgbox "hello"
end if


it doesnt work
can u use like
imgnextquestion.pciture = button - next question

or sumthing
pls help

this is what i have and it doest work

Code:
If (imgcheck.Visible = True) And (imgnextquestion.Picture = LoadPicture("C:WindowsButton - Next Question.gif")) Then
MsgBox "Please Click Next Question!", vbInformation, "Info Message"
ElseIf imgnextquestion.Picture = LoadPicture("C:WindowsButton - Next Question.gif") Then
lbldisplay.Caption = "You have Selected Option B, Click 'Check Answer'"
ElseIf imgnextquestion.Picture = LoadPicture("C:Windowsutton - begin.gif") Then
MsgBox "Please click Begin"
End If



thanks Trav

Image Boxes
is there a way to unload a picture from an image box. I used the loadpicture to place an image in the box but when i click a command button i want it to remove that picture. Is there a way to do this?

Image Boxes
No, i'm not a lamer, i just cant figure it out.

i have an imagebox names image1(1). now.. during the run-time i want to be able to make a duplicate of this image, and call it image1(2) or image2(1). how can this be done? i have tried to dim it as new, but imagebox is not an option. any help is apreaciated. thanx!

[Edited by da404LewZer on 03-20-2000 at 02:17 AM]

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?

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