BarCodeGetWidth128
BarCodeGetWidth128
This method is listed in the help file, but when I try to use it I get an OLE Error for unknown name.
I am trying to create a barcode image in VFP and need to set the image to the correct width.
Parameters lcCode, cNewFileName
oDGPicture = Createobject("gdpicturepro5.imaging")
oDGPicture.SetLicenseNumber("MyLicCode")
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40) && Breaks here
oDGPicture.CreateNewImage((nWidth + 5), 50, 32, 16777215)
oDGPicture.BarCodeDraw128(lcCode, 5, 5, 40)
oDGPicture.SaveAsJpeg(LOWER(cNewFileName),100)
Release oDGPicture
I am trying to create a barcode image in VFP and need to set the image to the correct width.
Parameters lcCode, cNewFileName
oDGPicture = Createobject("gdpicturepro5.imaging")
oDGPicture.SetLicenseNumber("MyLicCode")
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40) && Breaks here
oDGPicture.CreateNewImage((nWidth + 5), 50, 32, 16777215)
oDGPicture.BarCodeDraw128(lcCode, 5, 5, 40)
oDGPicture.SaveAsJpeg(LOWER(cNewFileName),100)
Release oDGPicture
Re: BarCodeGetWidth128
Hello,
Your code works fine for me under vfp9. Are you using the latest version ?
You can get it from : https://www.gdpicture.com/download/legacy/v5/
Kind regards,
Loïc
Your code works fine for me under vfp9. Are you using the latest version ?
You can get it from : https://www.gdpicture.com/download/legacy/v5/
Kind regards,
Loïc
Re: BarCodeGetWidth128
Thank you, I don't get the OLE error, but width always returns 0?
Re: BarCodeGetWidth128
Could you provide a code snippet to reproduce the problem ?
Re: BarCodeGetWidth128
Same as above,
oDGPicture.BarCodeGetWidth128(lcCode, 40) returns zero
oDGPicture.BarCodeGetWidth128(lcCode, 40) returns zero
Re: BarCodeGetWidth128
ok but what is the content of the lcCode variable ?
Re: BarCodeGetWidth128
Anything, use any text value. I tried "TestBarcode" as my variable.
Re: BarCodeGetWidth128
ok I see. You have to handle an image prior getting a barcode width.
IE:
oDGPicture.CreateNewImage(1, 50, 32, 16777215)
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40)
IE:
oDGPicture.CreateNewImage(1, 50, 32, 16777215)
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40)
Re: BarCodeGetWidth128
Works, thanks.
But I am getting a black image now since I upgraded, any ideas?
Parameters lcCode, cNewFileName
oDGPicture = Createobject("gdpicturepro5.imaging")
oDGPicture.SetLicenseNumber("MyCode")
oDGPicture.SetVerticalResolution(300)
oDGPicture.SetHorizontalResolution(300)
oDGPicture.CreateNewImage(200, 50, 32, 16777215)
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40) + 5
oDGPicture.ResizeImage(nWidth, 50)
oDGPicture.BarCodeDraw128(lcCode, 5, 5, 40)
oDGPicture.SaveAsJpeg(LOWER(cNewFileName),100)
Release oDGPicture
But I am getting a black image now since I upgraded, any ideas?
Parameters lcCode, cNewFileName
oDGPicture = Createobject("gdpicturepro5.imaging")
oDGPicture.SetLicenseNumber("MyCode")
oDGPicture.SetVerticalResolution(300)
oDGPicture.SetHorizontalResolution(300)
oDGPicture.CreateNewImage(200, 50, 32, 16777215)
nWidth = oDGPicture.BarCodeGetWidth128(lcCode, 40) + 5
oDGPicture.ResizeImage(nWidth, 50)
oDGPicture.BarCodeDraw128(lcCode, 5, 5, 40)
oDGPicture.SaveAsJpeg(LOWER(cNewFileName),100)
Release oDGPicture
Re: BarCodeGetWidth128
replace 16777215 by a proper color value. IE: ARGB(255,255,255,255)
Re: BarCodeGetWidth128
You're welcome !
Thank you for the return.
Regards,
Loïc
Thank you for the return.
Regards,
Loïc
Who is online
Users browsing this forum: No registered users and 2 guests