Error 1 GenericError on crop
Error 1 GenericError on crop
I'm evaluating GDViewer Pro. It keeps returning a "1 GenericError" when on the following statement. Can someone tell me what I'm doing wrong?
THIS.oimaging.crop(THIS.ogdviewer.getrectx,THIS.ogdviewer.getrecty,THIS.ogdviewer.getrectwidth,THIS.ogdviewer.getrectheight)
An example of how to crop would be great!
Thanks in advance.
THIS.oimaging.crop(THIS.ogdviewer.getrectx,THIS.ogdviewer.getrecty,THIS.ogdviewer.getrectwidth,THIS.ogdviewer.getrectheight)
An example of how to crop would be great!
Thanks in advance.
Re: Error 1 GenericError on crop
You must first set/draw the rectangle you wish to crop and then crop to those rectangle coordinates.
Here is VB6 code that sets, gets a rectangle and then crops an image to that rectangle and then displays in the viewer:
Hope this helps you.
Edit: I just noticed you are using GdViewer Pro. To use the Crop Method you must use the GdPicture Pro package.
Tom
Here is VB6 code that sets, gets a rectangle and then crops an image to that rectangle and then displays in the viewer:
Code: Select all
Dim nleft as Long, ntop as Long, nWidth as Long, nHeight as Long
'First set area to crop
nleft = 0
ntop = 0
nWidth = 100
nHeight = 100
oGdViewerCnt.SetRectValues (nLeft, nTop, nWidth, nHeight)
'Now crop to that area
If oGdViewerCnt.isRectDrawed Then
Call oGdViewerCnt.GetRectValues(nleft, ntop, nWidth, nHeight)
Call Imaging1.Crop(nleft, ntop, nWidth, nHeight)
Call oGdViewerCnt.SetNativeImage(Imaging1.GetNativeImage)
Else
MsgBox "There is no selection made!", vbOKOnly, " Error Information"
End If
Edit: I just noticed you are using GdViewer Pro. To use the Crop Method you must use the GdPicture Pro package.
Tom
Re: Error 1 GenericError on crop
Thanks Tom.\
I am using the GdPicture Pro package in "Demo" mode.
Following your pattern I wrote the following code in VFP. The crop method is still returning a value of 1 "GenericError" when called. In addition, after the code below had run, nothing else on the form (zoom, rotate, etc...) works at all.
*First set area to crop
nleft = 0
ntop = 0
nwidth = 100
nheight = 100
THIS.ogdviewer.setrectvalues (nleft, ntop, nwidth, nheight)
*now crop to that area'
IF THIS.ogdviewer.isrectdrawed
THIS.ogdviewer.getrectvalues(nleft, ntop, nwidth, nheight)
IF THIS.oimaging.crop(nleft, ntop, nwidth, nheight) > 0
WAIT WINDOW "Error # "+STR(THIS.oimaging.crop(nleft, ntop, nwidth, nheight))
ENDIF
THIS.ogdviewer.setnativeimage(THIS.oimaging.getnativeimage)
ELSE
WAIT WINDOW "There is no selection made!"
ENDIF
BTW: I'm running Win7 64bit.
I am using the GdPicture Pro package in "Demo" mode.
Following your pattern I wrote the following code in VFP. The crop method is still returning a value of 1 "GenericError" when called. In addition, after the code below had run, nothing else on the form (zoom, rotate, etc...) works at all.
*First set area to crop
nleft = 0
ntop = 0
nwidth = 100
nheight = 100
THIS.ogdviewer.setrectvalues (nleft, ntop, nwidth, nheight)
*now crop to that area'
IF THIS.ogdviewer.isrectdrawed
THIS.ogdviewer.getrectvalues(nleft, ntop, nwidth, nheight)
IF THIS.oimaging.crop(nleft, ntop, nwidth, nheight) > 0
WAIT WINDOW "Error # "+STR(THIS.oimaging.crop(nleft, ntop, nwidth, nheight))
ENDIF
THIS.ogdviewer.setnativeimage(THIS.oimaging.getnativeimage)
ELSE
WAIT WINDOW "There is no selection made!"
ENDIF
BTW: I'm running Win7 64bit.
Re: Error 1 GenericError on crop
Hi:
Sorry... I know nothing about VFP or what may be happening in that environment.
Perhaps Loic can better help you.
Tom
Sorry... I know nothing about VFP or what may be happening in that environment.
Perhaps Loic can better help you.
Tom
Who is online
Users browsing this forum: No registered users and 1 guest