LEADTOOLS Support
Imaging
Imaging SDK Questions
Navigate on loaded image (RasterimageViewer) with arrow keys?
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, January 19, 2011 4:47:07 AM(UTC)
Groups: Registered
Posts: 40
Thanks: 5 times
Hello
Im using WindowsFormApp in vb.net , LT v17
It's possible to move (navigate) on image by using the arrow keys (or combined ctrl + arrow Up/Down/Left/Right) in RasterimageViewer?
Best Regards
AN
#2
Posted
:
Wednesday, January 19, 2011 5:28:22 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Yes, you can move the image on the rasterImageViewer control by changing the rasterImageViewer1.ScrollPosition property value.
You need to change the rasterImageViewer1.ScrollPosition property value inside the rasterImageViewer.KeyUp event.
The code will be something as follows:
+----------+
private void Form1_Load(object sender, EventArgs e)
{
RasterCodecs codecs = new RasterCodecs();
rasterImageViewer1.Image = codecs.Load(@"C:\DelMe\OCR1.TIF");
rasterImageViewer1.KeyUp += new KeyEventHandler(rasterImageViewer1_KeyUp);
}
void rasterImageViewer1_KeyUp(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Up:
rasterImageViewer1.ScrollPosition = new Point(rasterImageViewer1.ScrollPosition.X, rasterImageViewer1.ScrollPosition.Y - 10);
break;
case Keys.Down:
rasterImageViewer1.ScrollPosition = new Point(rasterImageViewer1.ScrollPosition.X, rasterImageViewer1.ScrollPosition.Y + 10);
break;
case Keys.Left:
rasterImageViewer1.ScrollPosition = new Point(rasterImageViewer1.ScrollPosition.X - 10, rasterImageViewer1.ScrollPosition.Y);
break;
case Keys.Right:
rasterImageViewer1.ScrollPosition = new Point(rasterImageViewer1.ScrollPosition.X + 10, rasterImageViewer1.ScrollPosition.Y);
break;
}
rasterImageViewer1.Refresh();
}
+----------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Wednesday, January 19, 2011 6:55:49 AM(UTC)
Groups: Registered
Posts: 40
Thanks: 5 times
LEADTOOLS Support
Imaging
Imaging SDK Questions
Navigate on loaded image (RasterimageViewer) with arrow keys?
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.