473,543 Members | 2,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 17 '05 #1
4 15477
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*****@hotmai l.com>
wrote:
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


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


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******* *************@c omcast.com>...
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])

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
7254
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 inside the picture box?? If anything is unclear, please let me know. Any help would be greatly appreciated! Regards
0
3116
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 that I can get as byte or MemoryStream and I need to insert these images into RTF document using C#. Maybe it's not a very bad idea to insert pairs of pictures using like a two-column table, each...
6
1822
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 small images that fit, everything is ok. How can I fit in larger pictures? (Ideally would be that the picture is centered and fit in the box) Is this possible with the standard control?
2
941
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 this? thanks in advance, Pieter
1
1605
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 picture isn't moving now ) thanks
2
15877
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 come i can load this picture pic.jpg into Picturebox? Thanks in advance
8
1926
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 and DrawLines method of the Graphics. So it really paints like in the Paint of windows. When I let the mouse left button up it stops drawing of course. Now I want to rotate that paint (which is...
4
8372
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 picturebox. I tried the "behaviour options" in visual studios properties but alas no luck. Is there a way around this? Thank you.
2
5771
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 it to be more flexible that the standard defines. For example, I want to be able to delete a portion of the buffer and move the data behind the deleted part upwards, sort of like in a List. To...
0
7349
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7590
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7735
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7347
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7688
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5885
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5271
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3391
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1817
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.