This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, February 26, 2008 12:19:05 AM(UTC)
Groups: Registered
Posts: 4
Hi,
I'm using COM components V14.5 in VS 2005 C#
The application displays an image in the main window as selected by the user, and displays the PanWindow for context when zooming and panning.
When a new image is selected into the main AxLEADRasterView, the PanWindow gets automatically resized, presumably based on the image aspect ratio and/or original image size. The problem is that it always gets resized smaller, so that if the user swaps back and forth between two images of different aspect ratio then the PanWindow shrinks on each swap to become too small to be useful. After two or three swaps the Pan Window stabilises at around 100 x 90 pixels.
Setting PanWinWidth and PanWinHeight in code doesn't seem to have any effect, and there don't seem to be any suitable events to get the timing right anyway.
Does anyone know how to keep control of the size of the PanWindow, or understand its default behaviour so that I can implement a workaround?
thanks,
bert
#2
Posted
:
Tuesday, February 26, 2008 1:23:04 AM(UTC)
Groups: Registered
Posts: 4
Hi,
answering my own question again after a bit of trial and error. In my opinion, the solution is a bit clunky due to the redraw flicker effect, so any other suggestions welcome.
The answer for the moment was to add an event handler for the PanWin event, check the size of the PanWindow, and if it's too small then Hide it (doesn't work otherwise), set its size, and show it again...
private void axLEADRasterView1_PanWin(object sender, AxLTRASTERVIEWLib._LEADRasterViewEvents_PanWinEvent e)
{
//This determined by trial and error
//without it, the Pan/Overview window gradually shrinks
//when you swap between images of different aspect ratio
if (e.iFlag == 4)
{
if (axLEADRasterView1.PanWinWidth < 160)
{
axLEADRasterView1.ShowPanWin(false);
axLEADRasterView1.PanWinWidth = 160;
axLEADRasterView1.PanWinHeight = 160;
axLEADRasterView1.ShowPanWin(true);
}
}
}
cheers,
bert
#3
Posted
:
Wednesday, February 27, 2008 5:30:57 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
I have made a project with a different approach to your problem.
In this project, the PanWindow will be hidden and re-shows (just like you did it), but this will take place when any changes are made to the loaded bitmap affecting its width or height (or both).
This is done by handling the LEADRasterView Change event.
The project is packed in the attached "TestPanWin.zip".
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.