473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scroll bars in image

I'm trying to load an image in a PictureBox but I want the PictureBox has
always the same size and if the image is bigger, show a scrollBars.
How can I do it?
Thank you
Nov 16 '05 #1
3 13364
Hi Alberto

A simpler thing would be include the ImageBox inside a panel then you just
move the ImageBox and the panel will works like a windows, which is what you
want.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alberto" <al*****@nospam .com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
I'm trying to load an image in a PictureBox but I want the PictureBox has
always the same size and if the image is bigger, show a scrollBars.
How can I do it?
Thank you

Nov 16 '05 #2
It doesn't work. I have a pictureBox inside a panel control but when I load
a picture bigger than the PictureBox control, the bars doesn't appear.
I load the image in the paint event with this sentence:
e.graphics.Draw image(Image, 0,0);

Thank you.

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
escribió en el mensaje news:e4******** ******@tk2msftn gp13.phx.gbl...
Hi Alberto

A simpler thing would be include the ImageBox inside a panel then you just move the ImageBox and the panel will works like a windows, which is what you want.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alberto" <al*****@nospam .com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
I'm trying to load an image in a PictureBox but I want the PictureBox has always the same size and if the image is bigger, show a scrollBars.
How can I do it?
Thank you


Nov 16 '05 #3
Hi,

Why you load the image in the paint event?
You just load it once and that's all, after that all you would have to do
is reposition your picturebox.

below you will find a piece of code I just did for testing,
When I click on the button I load an image, the picturebox has SizeMode set
to autosize
the picturebox is inside the panel
//
// panel1
//
this.panel1.Con trols.Add(this. pictureBox1);

This is what I do when the button is pressed, you have to change it to
refrect your need
private void button1_Click(o bject sender, System.EventArg s e)
{
Bitmap b = new Bitmap( @"c:\imagenlogi n.jpg" );
pictureBox1.Ima ge = b;
}

I added a scrollbar next to the panel, this is the code for the handler
private void vScrollBar1_Scr oll(object sender,
System.Windows. Forms.ScrollEve ntArgs e)
{
pictureBox1.Top = -e.NewValue;
}
It does work as intended, if you still need help let me know and I will post
the complete code for the page
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alberto" <al*****@nospam .com> wrote in message
news:Ov******** ******@TK2MSFTN GP09.phx.gbl...
It doesn't work. I have a pictureBox inside a panel control but when I load a picture bigger than the PictureBox control, the bars doesn't appear.
I load the image in the paint event with this sentence:
e.graphics.Draw image(Image, 0,0);

Thank you.

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >
escribió en el mensaje news:e4******** ******@tk2msftn gp13.phx.gbl...
Hi Alberto

A simpler thing would be include the ImageBox inside a panel then you

just
move the ImageBox and the panel will works like a windows, which is what

you
want.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Alberto" <al*****@nospam .com> wrote in message
news:%2******** *******@tk2msft ngp13.phx.gbl.. .
I'm trying to load an image in a PictureBox but I want the PictureBox has always the same size and if the image is bigger, show a scrollBars.
How can I do it?
Thank you



Nov 16 '05 #4

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

Similar topics

1
4959
by: Mark | last post by:
Hi, Can someone help me please. I have been trying to do this for a day now and no luck. I need to display a picture in ms access 2002 on a form using any control with scroll bars. I basically wanna clip the picture but the image control will have scroll bars that will move the picture inside the control. I don't wanna zoom or strecth the...
0
1655
by: Eric | last post by:
I have a TableLayout that I'm having problems with. I am placing controls in it that have scroll bars. When I put enough of them on the control to make the TableLayout's scroll bars appear the scroll bars for the TableLayout cover up my scroll bars for the child controls. When I resize the form it fixes and the child controls are in the...
7
18178
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to scroll the appearing vertical and horizontal scrolls bars of the Panel to the middle of their scrolling range so the contained PictureBox will be...
1
2409
by: makdtripper | last post by:
I create a bitmap image. I can draw and save it successfulyl...i need to know how to resize the bitmap when i add more and more drawings...or how to add scroll bars to a large created bitmap. My basic problem is to add scroll bars to a bitmap.
2
2211
by: usenet | last post by:
When I open a form design window in Access 2003 it *always* has scroll bars, this is even when the form itself is tiny. It's as if the 'page' on which the form is being designed is very large. Is this normal? If so it's very annoying and confusing. If not then how do I get it so my form design window doesn't have scroll bars. --...
69
13361
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow resize and no auto horizontal, vertical scrolling bars. I am wonder can I do the similar inside a HTML file like
2
5230
by: nirmalpatel126 | last post by:
i have to use 3 check boxes and scroll bars to control the amount of red, green and blue to be used to change the image.
1
2399
by: David_from_Chicago | last post by:
I am developing an application in Access 2000 (A2K) which has multiple forms and subforms. Until now, all subforms displayed scroll bars properly (according to the subform's property setting). However, a new subform control will not display horizontal scroll bars despite it's form's property setting. I have tried deleting and recreating...
7
5384
by: dablyz | last post by:
Hi there. Im currently trying to design a project, that loads local images using a dialog box, puts them in a picture box, and changes the height and width, based on the values of scroll bars. The code that calls the loaded image to the picture box is picBox.Image = Image.FromFile(.FileName) Im just stuck on where to go from here! This...
6
4600
by: bgold12 | last post by:
I was using quirks mode (without a doctype) and set the overflow CSS property to :auto for the body tag like so: <body style="overflow:auto"> And it worked; it got rid of IE's default scroll bars. However, when I tried to add any doctype at all (HTML strict, HTML loose, XHTML transitional, XHTML strict, etc.), it stopped working. Do I...
0
7401
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
7656
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
7808
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
7423
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
7757
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
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
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
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.