Drawing line on an Image

Discussions about image processing and document imaging.
Post Reply
mvrnaidu
Posts: 15
Joined: Thu Feb 16, 2012 1:17 pm

Drawing line on an Image

Post by mvrnaidu » Sat Mar 17, 2012 7:15 am

Hi,
I am getting "Generic Error" on trying to draw a line on a loaded image. I used the followig code. Please help.

Code: Select all

x[index] = gdViewer1.GetMouseLeftInDocument();
            y[index] = gdViewer1.GetMouseTopInDocument();

            //Imaging.draw
            try
            {
                //if (Imaging.DrawCircle(m_TmpImage, x[index], y[index], 10, Imaging.ARGB(255, 120, 120, 255), 5, true) != GdPictureStatus.OK)
                //    MessageBox.Show("Error: " + Imaging.GetStat().ToString());
                if (Imaging.DrawLine(m_TmpImage, x[index], y[index] - 10,
                                            x[index], y[index] + 10, 5, Imaging.ARGB(255, 120, 120, 255), true) != GdPictureStatus.OK)
                    MessageBox.Show("Error: " + Imaging.GetStat().ToString());
            }
            catch (Exception ex)
            { }
Thanks in advance.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Drawing line on an Image

Post by Loïc » Sat Mar 17, 2012 10:44 am

Hello,

I suppose that m_TmpImage is a reference to a non existing GdPicture Image.

kind regards,

Loïc

mvrnaidu
Posts: 15
Joined: Thu Feb 16, 2012 1:17 pm

Re: Drawing line on an Image

Post by mvrnaidu » Sat Mar 17, 2012 12:09 pm

It is not that case. The imageid returned was 1. Ultimately I could overcome Generic erroe, but couldnt draw a line on existing image.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Drawing line on an Image

Post by Loïc » Sun Mar 18, 2012 1:24 pm

Hello,

Could you provide more code for me to reproduce the error ?

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest