|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Form Picture!I want a background image/picture for my VB6 application that has 3
Forms (not the controls). How do I do that? I tried to set the "Picture" property of the Form but that doesn't do the needful. Please note that I want the background image for all the 3 Forms. Thanks, Arpan "Arpan" <arpan***@hotmail.com> wrote Why not?> I want a background image/picture for my VB6 application that has 3 > Forms (not the controls). How do I do that? I tried to set the > "Picture" property of the Form but that doesn't do the needful. > Please note that I want the background image for all the 3 Forms. Then re-assign the pictures as you show the form's:Form2.Picture = Me.Picture Form2.Show >>Why not? No idea why? If I am not mistaken, the image should cover all thoseareas of the Form that aren't occupied by the different controls i.e. the space in between the different controls should show the image but that doesn't happen; the background image covers only a part of the empty space. >>Then re-assign the pictures as you show the form's: Form2.Picture = Me.Picture>>Form2.Show Tried this as well but that doesn't make any difference.Any other suggestion? Thanks, Regards, Arpan On 22 Oct 2005 04:03:53 -0700, "Arpan" <arpan***@hotmail.com> wrote: Which part does it NOT cover ?>>>Why not? > >No idea why? If I am not mistaken, the image should cover all those >areas of the Form that aren't occupied by the different controls i.e. >the space in between the different controls should show the image but >that doesn't happen; the background image covers only a part of the >empty space. You probably want to stretch draw the Picture Look at the Form.PaintPicture method "Arpan" <arpan***@hotmail.com> wrote... No, the form's picture does not resize to fit the form. If you want the picture> >>Why not? > > No idea why? If I am not mistaken, the image should cover all those > areas of the Form that aren't occupied by the different controls to always fit the form, you might try an image control which has a stretch property. Private Sub Form_Load() Image1.Stretch = True Image1.Picture = LoadPicture("C:\My Documents\My Pictures\Iceberg.jpg") End Sub Private Sub Form_Resize() Image1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight End Sub David .. Show quoteHide quote > the space in between the different controls should show the image but > that doesn't happen; the background image covers only a part of the > empty space. > > >>Then re-assign the pictures as you show the form's: > > Form2.Picture = Me.Picture > >>Form2.Show > > Tried this as well but that doesn't make any difference. > > Any other suggestion? > > Thanks, > > Regards, > > Arpan > "Arpan" <arpan***@hotmail.com> wrote in message Right. It looks as though your image (.bmp, jpg or whatever) has a pixel news:1129979033.622888.216740@g49g2000cwa.googlegroups.com... > No idea why? If I am not mistaken, the image should cover all > those areas of the Form that aren't occupied by the different > controls i.e.the space in between the different controls should > show the image but that doesn't happen; the background image > covers only a part of the empty space. size that is smaller than the Form. In that case there are various options. One way would be to set your Form's Autoredraw property to True and to paint your image onto the Form at the appropriate size using the VB PaintPicture method. Note that the pixel size of the Form's Autoredraw Image is the same size as the client area of the Form (if it is a fixed size Form) and the same size as the screen (800 x 600 or whatever) if it is a Sizeable Form. However, you need to be aware that "stretching" images to a size that is larger than their original pixel size will produce a poor quality picture. You'd be far better off finding a suitable image that is as large as possible (and preferably the same size or larger than the size of the display). Mike I must say that experts in this newsgroup are really forthcoming. Post
one query & within the next 30 minutes, there will be different suggestions/solutions accompanying the query. The gurus are ready to pounce in to guide needy people like me. Great work.....keep it up & I really mean each & every word I have said above. A zillion thanks won't be enough to reciprocate. Thanks to one & all for your inputs. I finally settled for David's suggestion. Regards, Arpan "Arpan" <arpan***@hotmail.com> wrote in message What do you mean by, "It doesn't do the needful". Setting the Picture news:1129973955.829026.92920@g49g2000cwa.googlegroups.com... > I tried to set the "Picture" property of the Form but that doesn't > do the needful. property of a Form (either at runtime or in the VB IDE) will cause that picture to be displayed as the Form's background. Isn't that what you want? > Please note that I want the background image for all the 3 Forms. .. . . or is it perhaps that it did indeed "do the needful" for the Form that you specified but that you were hoping it would also automatically do it for all three Forms? (Best if you can be as specific as possble whgen posting querstions). You can, of course, simply set each of the three Forms' Picture properties to the same picture at design time. That, however, would result in the same picture data being included three times in your compiled exe (which is perhaps what you are trying to avoid). In that case just set one Picture property at design time and then set the others to the same picture in code at run time. There are all sorts of different ways of doing it, but you'll need to tell us exactly what you want to do, and why. Mike > I want a background image/picture for my VB6 application that Where is the background picture stored at? In a file? If so,has 3 > Forms (not the controls). How do I do that? I tried to set the > "Picture" property of the Form but that doesn't do the needful. assign it to the form this way... Set Form1.Picture = LoadPicture("c:\Directory\Path\YourPicture.bmp") > Please note that I want the background image for all the 3 Just do the above assignment to each form's Picture property. IfForms. these assignment are "permanent" and non-changing, you could assign the picture file to the Picture property at design time using the Property Window. Rick |
|||||||||||||||||||||||