Moving a picture inside a picturebox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    Moving a picture inside a picturebox

    Hi,

    I am trying to set the position of a picture inside a picturebox with the
    folowing code:

    pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", [Size],
    [ColorDepth], [X], [Y])

    I didn't know what to fill in at [Size] and [ColorDepth] so the result was:

    pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", (315) - (315),
    1, x2, y2)
    '(x2 and y2 are declared variables)

    My problem is that the picture hasn't moved at all, it's still in the upper
    left corner :(
    Does anyone here know how to set the position of a picture inside a
    picturebox?

    Thanks for your help.

    Chris


  • J French

    #2
    Re: Moving a picture inside a picturebox

    Is that VB.NET ?

    If so you would be better of in a dotnet NG

    On Fri, 26 Mar 2004 10:29:33 +0100, "Chris" <c987web@hotmai l.com>
    wrote:
    [color=blue]
    >Hi,
    >
    >I am trying to set the position of a picture inside a picturebox with the
    >folowing code:
    >
    > pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", [Size],
    >[ColorDepth], [X], [Y])
    >
    >I didn't know what to fill in at [Size] and [ColorDepth] so the result was:
    >
    > pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", (315) - (315),
    >1, x2, y2)
    > '(x2 and y2 are declared variables)
    >
    >My problem is that the picture hasn't moved at all, it's still in the upper
    >left corner :(
    >Does anyone here know how to set the position of a picture inside a
    >picturebox?
    >
    >Thanks for your help.
    >
    >Chris
    >
    >[/color]

    Comment

    • Rick Rothstein

      #3
      Re: Moving a picture inside a picturebox

      > I am trying to set the position of a picture inside a picturebox with the[color=blue]
      > folowing code:
      >
      > pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", [Size],
      > [ColorDepth], [X], [Y])
      >
      > I didn't know what to fill in at [Size] and [ColorDepth] so the result[/color]
      was:[color=blue]
      >
      > pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", (315) -[/color]
      (315),[color=blue]
      > 1, x2, y2)
      > '(x2 and y2 are declared variables)
      >
      > My problem is that the picture hasn't moved at all, it's still in the[/color]
      upper[color=blue]
      > left corner :(
      > Does anyone here know how to set the position of a picture inside a
      > picturebox?[/color]

      You could always put an Image control **IN** (not merely on top of) the
      PictureBox, load your picture into the Image control and place the picture
      wherever you want via the Image control's Top and Left properties.

      Rick - MVP


      Comment

      • J French

        #4
        Re: Moving a picture inside a picturebox

        On Fri, 26 Mar 2004 09:36:42 +0000 (UTC), erewhon@nowhere .com (J
        French) wrote:
        [color=blue]
        >Is that VB.NET ?
        >
        >If so you would be better of in a dotnet NG
        >[/color]

        Ah, sorry, it is a VB6 enhancement

        Size should be: vbLPCustom

        ColorDepth try : vbLPDefault

        Here is the link - watch for wrapping:



        Here is the same:





        Comment

        • Bob Butler

          #5
          Re: Moving a picture inside a picturebox

          "Rick Rothstein" <rickNOSPAMnews @NOSPAMcomcast. net> wrote in message news:<0dednTsq9 pvPYf7dRVn-hg@comcast.com> ...[color=blue][color=green]
          > > I am trying to set the position of a picture inside a picturebox with the
          > > folowing code:
          > >
          > > pctOutput.Pictu re = LoadPicture(App .Path & "\picture.b mp", [Size],
          > > [ColorDepth], [X], [Y])[/color][/color]

          The x and y arguments specify width & height, not top & left; top &
          left are always 0,0
          [color=blue]
          > You could always put an Image control **IN** (not merely on top of) the
          > PictureBox, load your picture into the Image control and place the picture
          > wherever you want via the Image control's Top and Left properties.[/color]

          that or load it into an image or picturebox (or form or anything that
          accepts an image) and the use the PaintPicture method to re-draw it
          where it should be

          Comment

          Working...