Magnify Image?

J

Joe Cool

I have an application that does some things with JPG images. One thing
it does is display the image in full screen mode. I would like to add
a "magnify" feature in this full screen mode where the area under the
mouse is zoomed into while the mouse button is down. The actual size
of the JPG is larger than the physical screen so more detail should be
seen.

I have tried to move the form that is showing the image to an area
outside of the primary screen area by descreasing the Top and Left
properties to less than zero (the original value), and increasing the
height and width of the form so the overall size is larger than the
primary screen. But nothing happens. Debug output shows that the form
properties are not being changed.

What am I missing?
 
J

Joe Cool

I have an application that does some things with JPG images. One thing
it does is display the image in full screen mode. I would like to add
a "magnify" feature in this full screen mode where the area under the
mouse is zoomed into while the mouse button is down. The actual size
of the JPG is larger than the physical screen so more detail should be
seen.

I have tried to move the form that is showing the image to an area
outside of the primary screen area by descreasing the Top and Left
properties to less than zero (the original  value), and increasing the
height and width of the form so the overall size is larger than the
primary screen. But nothing happens. Debug output shows that the form
properties are not being changed.

What am I missing?

OK, part of the problem was that I had inadvertantly set the full
screen form's windowstate to maximized, and you can't change the
location if maximized. So I have that set to normal. The form width
and height are set to the primary screen size before the form is
shown.

So the form now shifts over to the left and up, but it doesn't resize
larger. I have the form's border style to none since I do not want any
bordering or caption bar. But apparently, borderstyle none will not
let you resize the window in code?

I am wondering why I am able to resize the form prior to showing it,
but cannot after it is shown?
 
P

Peter Duniho

[...]
So the form now shifts over to the left and up, but it doesn't resize
larger. I have the form's border style to none since I do not want any
bordering or caption bar. But apparently, borderstyle none will not
let you resize the window in code?

I am wondering why I am able to resize the form prior to showing it,
but cannot after it is shown?

From the documentation: "The border style of the form determines how the
outer edge of the form appears. In addition to changing the border display
for a form, certain border styles prevent the form from being sized"

AFAIK, the only border styles that allow resizing are those with the word
"Sizable" in the name.

From your description, it sounds as though you want the magnified area to
be displayed on the entire screen. At least, that's the only thing that
makes sense to me given that you are trying to do this by manipulating the
form size and position.

You may be able to work around the issue by temporarily changing the
border style when you want to change the size of the form, or maybe just
leave it as a sizable border style.

That said, it seems to me that it would be better to not conflate your UI
"framework" (i.e. the form, it's border, etc.) with the specific display
behavior you want for the content of the UI. It would not be that much
harder to simply write a control that can display an image, and optionally
provide magnification at the appropriate moment. Then the control will
work no matter what its state, or rather...the control will always have
the same state and its position and relation to the screen will depend not
on itself but rather the UI around it (the state of which you'll be able
to change at will without affecting the image display control).

Pete
 
J

Jeff Johnson

I have an application that does some things with JPG images. One thing
it does is display the image in full screen mode. I would like to add
a "magnify" feature in this full screen mode where the area under the
mouse is zoomed into while the mouse button is down. The actual size
of the JPG is larger than the physical screen so more detail should be
seen.

http://bobpowell.net/canvas.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top