Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 26, 2008 12:19:05 AM(UTC)


Groups: Registered
Posts: 4


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?




Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, February 26, 2008 1:23:04 AM(UTC)


Groups: Registered
Posts: 4


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.PanWinWidth = 160;
         axLEADRasterView1.PanWinHeight = 160;



#3 Posted : Wednesday, February 27, 2008 5:30:57 AM(UTC)

Yasir Alani  

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".
File Attachment(s):
TestPanWin.zip (3kb) downloaded 27 time(s).
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.065 seconds.