473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Image Viewer ...

Hi all

I need to do a image viewer, just to view and zoom pictures
in jpeg. I do not need to edit or save the picture.

I am sure, there are some controls already made.
I am thankful for any comment on that !

Best regards
Frank Uray
Dec 7 '07 #1
4 6442
Hello Frank,

You need to use GDI+ for this.
Use MSDN for more info and google to find samples how to use it
http://www.c-sharpcorner.com/UploadF.../gdi_plus.aspx

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
FUHi all
FU>
FUI need to do a image viewer, just to view and zoom pictures in jpeg.
FUI do not need to edit or save the picture.
FU>
FUI am sure, there are some controls already made.
FUI am thankful for any comment on that !
FUBest regards
FUFrank Uray
Dec 7 '07 #2
On Dec 7, 6:43 am, Frank Uray <FrankU...@discussions.microsoft.com>
wrote:
Hi all

I need to do a image viewer, just to view and zoom pictures
in jpeg. I do not need to edit or save the picture.

I am sure, there are some controls already made.
I am thankful for any comment on that !
I would recommend doing research into the System.Drawing Image Class:

http://msdn2.microsoft.com/en-us/lib...ing.image.aspx

And into the System.Windows.Forms PictureBox control:

http://msdn2.microsoft.com/en-us/lib...icturebox.aspx

The PictureBox control has an Image property that works exactly like
the Image Class. Pay particular attention to the PictureBox SizeMode
property.

There is no builtin .NET code to do zooming, but it can be
accomplished by setting the Top and Left properties of the picturebox
to be outside of the form.

Dec 7 '07 #3
On Dec 7, 9:25 am, za...@construction-imaging.com wrote:
On Dec 7, 6:43 am, Frank Uray <FrankU...@discussions.microsoft.com>
wrote:
Hi all
I need to do a image viewer, just to view and zoom pictures
in jpeg. I do not need to edit or save the picture.
I am sure, there are some controls already made.
I am thankful for any comment on that !

I would recommend doing research into the System.Drawing Image Class:

http://msdn2.microsoft.com/en-us/lib...ing.image.aspx

And into the System.Windows.Forms PictureBox control:

http://msdn2.microsoft.com/en-us/lib....forms.picture...

The PictureBox control has an Image property that works exactly like
the Image Class. Pay particular attention to the PictureBox SizeMode
property.

There is no builtin .NET code to do zooming, but it can be
accomplished by setting the Top and Left properties of the picturebox
to be outside of the form.
Let me add something. One of the valid values for the
PictureBox.SizeMode property is Zoom which will make images larger on
the screen, but only within the confines of the picturebox control
that contains the image. If you want to magnify it more, you will need
to do the technique I mentioned earlier.

The difference between SizeMode Zoom and SizeMode Stretch is that Zoom
maintains the image's aspect ratio, Stretch does not.
Dec 7 '07 #4
On Fri, 07 Dec 2007 06:25:55 -0800, <za***@construction-imaging.comwrote:
[...]
There is no builtin .NET code to do zooming, but it can be
accomplished by setting the Top and Left properties of the picturebox
to be outside of the form.
I think I would call that "panning". :)

The PictureBox does offer some minimal control over basic zooming
behavior. For anything more complicated than that, a custom control would
be required. Based on what little I know about WPF, using WPF is probably
the easiest way. But it wouldn't be hard to write a custom control that
handles it either.

Drawing oneself, you would presumably be using the Graphics.DrawImage()
method to draw the bitmap on the screen, in the form. To scale (zoom)
and/or offset (pan) the drawing, you can simply provide destination
dimensions for the image that are different from the source dimensions
(zoom in, dimensions are larger, zoom out, smaller...pan down and/or
right, origin of destination is to the left or up from the visible origin
in the control, and vice a versa). Alternatively, one can modify the
effective viewport being used to draw by creating a new transformation
matrix and assigning it to the Transform property of the Graphics instance
being used to draw.

Of course, you also need to provide a UI to control zoom and pan. That's
an entirely separate matter. But a standard click-and-drag or
scrollbar-based UI is fairly straightforward.

Pete
Dec 7 '07 #5

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

Similar topics

3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
2
by: Srinivas Chundi | last post by:
I have to display tif images using .asp page. I have tried to read the image as a binary file and stream it to the browser. The relevant code is as follows. Unfortunately, the display on the...
4
by: Shumit Rehman | last post by:
Hi I have a table which has path names to photos I would like to view. I would like to open some/any kind of image viewer(Paint) to see the picture when I click the pathname. The pictures are...
2
by: John Fryatt | last post by:
Hi, Before I go on, let me just say I'm fairly new at this so excuse me if I say the wrong thing or use the wrong term. Anyway, what I am trying to do is to set up something where I can have a...
0
by: Jerry J | last post by:
I have a third party image viewer that can display various types of images. The image viewer is ActiveX and lives inside of Internet Explorer. To get the image viewer to retrieve an image, java...
5
by: mikez | last post by:
Hi, We recently built a very basic file management system for a client in Access 2003 (to use with incoming tif scans). In it we used Microsoft's Document Imaging activex viewer (from Office...
1
by: Kuldeep | last post by:
Hello All, Could you please give me some leads on building a Image Viewer in .NET or how to use Windows Picture and Fax Viewer. The actual purpose is to display the image in my web application...
1
by: zee | last post by:
hello Is it possible to use Document Image Viewer Control in ASP.NET(2.0) because 1. The IDE is not adding this component in the toolbox and 2. when i use it so it give me following error ...
3
by: =?Utf-8?B?SlIx?= | last post by:
I would like to add text to an image. I have tried to use DrawString and it works on some images but on others it is very very small. I am pretty sure it has something to do with the size of the...
0
by: Andrew | last post by:
Hello Ive been messing around with a simple raw image viewer using Pil and Tkinter However I am running into problems displaying the images they appear to be not correct I believe it is cause of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...

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.