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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, June 10, 2008 6:37:30 PM(UTC)

fyjin99  
fyjin99

Groups: Registered
Posts: 8


I display the IRasterImage in scroll view. The OnPain() function as below:

    protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            if (image == null)
                return;
            Point pt = AutoScrollPosition;
            Graphics gfx = e.Graphics;
            int iDrawWidth;
            int iDrawHeight;
            iDrawWidth = ClientSize.Width - pt.X;
            iDrawHeight = ClientSize.Height - pt.Y;
            if (iDrawWidth >= image.Width)
                iDrawWidth = image.Width;
            if (iDrawHeight >= image.Height)
                iDrawHeight = image.Height;
            iDrawWidth += pt.X;
            iDrawHeight += pt.Y;
            Rectangle dstRect = new Rectangle(0, 0, iDrawWidth, iDrawHeight);
            Rectangle srcRect = new Rectangle(-pt.X, -pt.Y, iDrawWidth, iDrawHeight);
            image.Paint(gfx, srcRect, dstRect,RasterPaintProperties.Default);
        }
When the image loaded originally it works well. When the Vertical Scroll Bar in the Top and the image will show it's Top and when the Vertical Scroll Bar in the Bottom and the image will show it's Bottom.
But when the image was created from a DIB, like this:
image = RasterImage.FromDib(image.ToDib(RasterConvertToDibType.BitmapInfoHeader));
It doesn't work. When the Vertical Scroll Bar in the Top and the image will show it's Bottom! When the Vertical Scroll Bar in the Bottom and the image will show it's Top! I wonder what's happened.
 

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 : Wednesday, June 11, 2008 12:33:35 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,028

Was thanked: 2 time(s) in 2 post(s)


I think the problem is related to the image's view
perspective (orientation). However, I'm not sure how this happens or the best way to solve it.


 


Could you put your code in a small test project (not your
full application) that shows the problem? Pack the project in a ZIP or RAR file and post it here.


 


If you don't want to post your project here, please send it to support@leadtools.com and mention this forum post.

 
#3 Posted : Thursday, June 12, 2008 8:13:26 PM(UTC)

fyjin99  
fyjin99

Groups: Registered
Posts: 8


Thanks! It's the image's view perspective problem. I've solve it.
 
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-2020, Yet Another Forum.NET
This page was generated in 0.119 seconds.