473,586 Members | 2,702 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a large image scroll smoothly

Hi

I am trying to display a large image on the form and make the form
scrollable.
My image is about 4200 x 7000 pixel.

private void Form1_Paint(obj ect sender, System.Windows. Forms.PaintEven tArgs
e)
{
Graphics g=e.Graphics;
g.DrawImage(Ima ge,0,0,Image.Wi dth,Image.Heigh t);

}

The image display correctly and the scrolling works fine. However the
scrolling is not
smooth ( scrolling movement is jaggered ). Seems the image is not updated
fast enough.
I have tried with IE and photoshop to open the same image and both
application is able
to scroll the image quite smoothly. So far I have not seen any posted sample
that can scroll
large image smoothly.

I have even tried various method such as Clipping only the client region
using
Region r= new
Region(0,0,this .ClientRectangl e.Width,this.Cl ientRectangle.H eight);
g.Clip=r;

and using
Rectangle dr=new
Rectangle(0,0,t his.ClientRecta ngle.Width,this .ClientRectangl e.Height);
g.DrawImage(Ima ge,dr,dr,Graphi csUnit.Pixel);

but it stills does not achieve what I want.
Anyone have any idea how scroll very large image smoothly ?

Thanks
Danial


Jul 19 '05 #1
1 6511
Does this help?

SetStyle(Contro lStyles.DoubleB uffer, True)

SetStyle(Contro lStyles.AllPain tingInWmPaint, True)

Do this once, such as the New() of your Form. Maybe it won't
help with the size you are working with, but I'd be curious to know if
it helps.

"delong" <me****@ehomad. com> wrote in message
news:be******** **@mawar.singne t.com.sg...
Hi

I am trying to display a large image on the form and make the form
scrollable.
My image is about 4200 x 7000 pixel.

private void Form1_Paint(obj ect sender, System.Windows. Forms.PaintEven tArgs e)
{
Graphics g=e.Graphics;
g.DrawImage(Ima ge,0,0,Image.Wi dth,Image.Heigh t);

}

The image display correctly and the scrolling works fine. However the scrolling is not
smooth ( scrolling movement is jaggered ). Seems the image is not updated fast enough.
I have tried with IE and photoshop to open the same image and both
application is able
to scroll the image quite smoothly. So far I have not seen any posted sample that can scroll
large image smoothly.

I have even tried various method such as Clipping only the client region using
Region r= new
Region(0,0,this .ClientRectangl e.Width,this.Cl ientRectangle.H eight);
g.Clip=r;

and using
Rectangle dr=new
Rectangle(0,0,t his.ClientRecta ngle.Width,this .ClientRectangl e.Height); g.DrawImage(Ima ge,dr,dr,Graphi csUnit.Pixel);

but it stills does not achieve what I want.
Anyone have any idea how scroll very large image smoothly ?

Thanks
Danial

Jul 19 '05 #2

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

Similar topics

1
2523
by: CDB | last post by:
Hello I was running the Image Browser example (from the JAI book by Lawrence Rodrigues) with a very large image, specifically one of the size 12,000 x 6,000 pixels, and the image does not render inside the view port when using the original size display mode, the image appears to be loaded in memory, and the application appears to be...
2
4328
by: tripathy.asish | last post by:
Hi, I'm new here and was just hoping that some of you experts could help me! I would like to create a photo page using 'rollovers' however am finding it increasingly hard to find any information. I would like it to display around 10 thumbnails all leading to one big picture so when you hover over the image with the mouse it displays the...
1
361
by: delong | last post by:
Hi I am trying to display a large image on the form and make the form scrollable. My image is about 4200 x 7000 pixel. private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g=e.Graphics;
1
1058
by: Corane | last post by:
Hi, I created a usercontrol with PictureBoxes for process- visualisation. Is is possible to make an image of such a control for using this image in Crystal Report? Please help. Thank you.
2
1137
by: Corane | last post by:
Hi, Ik created a usercontrol with pictureboxes to display workflow. Is it possible to make an image from such a control for using this image in Crystal Report? Please respond. Thank you.
0
2151
by: tamfriend | last post by:
I have made a Image Scroll the Images are sourced from SQL database The Image start scrolling from the bottom...but i want the Image to start from top... ---------------------------------------------- <marquee scrollamount="3" direction="up"><asp:DataGrid id="clients" runat="server" Height="10px" AutoGenerateColumns="false"...
0
1398
by: Erakis | last post by:
Hi, I need to put a very large image as background (1030px X 774px) on the main window of my application. Also, on this window I need to add transparent Usercontrol, Panel and Label. Every time I need to refresh or replace a Usercontrol, the redraw is doing very TOO slow and there some flickering... I try to activate the double buffering...
3
1841
by: tictac | last post by:
Hi I want to show a large image in C#,but I recieve Out of memory error. how can I read the smaller block of my picture and show it.I work with GDI+. here is my code .I try to load one part of my picture but at last line of my code I recieve this error.my image is 20MB jpg with 12000*14000 Image MapImage = null; MapImage1 =...
36
2529
by: sh.vipin | last post by:
how to make large macro paste the code as it is Problem Explanation '-- For example in the program below /* a.c - starts here */ #define DECL_VARS() \ unsigned int a0;\ unsigned int a1;\ unsigned int a2;\
0
7911
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7839
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
8200
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. ...
1
7954
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
8215
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...
1
5710
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
3864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2345
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
1
1448
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.