472,353 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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.Picture = LoadPicture(App.Path & "\picture.bmp", [Size],
[ColorDepth], [X], [Y])

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

pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", (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
Jul 17 '05 #1
4 15326
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" <c9*****@hotmail.com>
wrote:
Hi,

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

pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", [Size],
[ColorDepth], [X], [Y])

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

pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", (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


Jul 17 '05 #2
> I am trying to set the position of a picture inside a picturebox with the
folowing code:

pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", [Size],
[ColorDepth], [X], [Y])

I didn't know what to fill in at [Size] and [ColorDepth] so the result was:
pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", (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?


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
Jul 17 '05 #3
On Fri, 26 Mar 2004 09:36:42 +0000 (UTC), er*****@nowhere.com (J
French) wrote:
Is that VB.NET ?

If so you would be better of in a dotnet NG


Ah, sorry, it is a VB6 enhancement

Size should be: vbLPCustom

ColorDepth try : vbLPDefault

Here is the link - watch for wrapping:

http://msdn.microsoft.com/library/de...oadpicture.asp

Here is the same:
http://tinyurl.com/2o6m8


Jul 17 '05 #4
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message news:<0d********************@comcast.com>...
I am trying to set the position of a picture inside a picturebox with the
folowing code:

pctOutput.Picture = LoadPicture(App.Path & "\picture.bmp", [Size],
[ColorDepth], [X], [Y])

The x and y arguments specify width & height, not top & left; top &
left are always 0,0
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.


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
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steven | last post by:
Hello, I have an Image Box in the asp.net page, which contains an Image. Is there anyway I can move that image with the mouse in any direction...
0
by: Just D. | last post by:
Does anybody know how can we insert the image from PictureBox.Image to richTextBox on the fly? Actually I'm having from 1 to 9 different pictures...
6
by: Dick | last post by:
Hello, In my application I have a picturebox that must contain previews of picture files. The picturebox must always have the same size. For...
2
by: DraguVaso | last post by:
Hi, I have a PictureBox in which I have a picture displayed. Now I want to have some lines and circles drawed above the picture. How do I do...
1
by: sagi | last post by:
hi i want to add a moving picture to my project it's a gif picture of a walking guy enyone know any function to do so? ( because the...
2
by: regin | last post by:
HI, i need to add a picture from a webpage to my application like new PictureBox(); if the image is there in www.picture.com/pic.jpg how...
8
by: Syoam4ka | last post by:
Hi, I have a WinApp in which I have a pictureBox. I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points...
4
DjPal
by: DjPal | last post by:
Hi, I have a picturebox in C#, visual studio 2008. when a picture is sent into the picturebox, the image is does not resize to the size of the...
2
Airslash
by: Airslash | last post by:
Hello, I'm currently working with a MemoryStream, because I need to work with a dynamic buffer that can grow depending on the needs. But I require...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.