Discussions on GFL SDK, the graphic library for reading and writing graphic files
Moderators: XnTriq , helmut , xnview
rmgarcia
Post
by rmgarcia » Thu Jun 24, 2004 5:02 pm
I use a GFL SDK v2.11 and I want to copy an image from clipboard and after save in a jpg file, but I get a 10 error, I don't understand, why?.
The visual basic code
Code: Select all
Error = gflImportFromClipboard(ptrimagen)
extGetGflBitmapFromPtr ptrimagen, imagen
MsgBox CStr(imagen.Width)
Error = gflChangeColorDepth(imagen, ptri, GFL_MODE_TO_RGB, GFL_MODE_NO_DITHER)
extGetGflBitmapFromPtr ptri, ima
parametros.FormatIndex = gflGetFormatIndexByName("jpeg")
parametros.Quality = 100
parametros.Progressive = False
parametros.OptimizeHuffmanTable = False
parametros.ChannelOrder = GFL_CTYPE_RGB
Error = gflSaveBitmap("c:\qw.jpg", ima, parametros)
MsgBox CStr(Error) ' Here show me 10
thanks for your help.
xnview
Author of XnView
Posts: 45247 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Thu Jun 24, 2004 6:58 pm
rmgarcia wrote: I use a GFL SDK v2.11 and I want to copy an image from clipboard and after save in a jpg file, but I get a 10 error, I don't understand, why?.
The visual basic code
Error = gflImportFromClipboard(ptrimagen)
extGetGflBitmapFromPtr ptrimagen, imagen
MsgBox CStr(imagen.Width)
Error = gflChangeColorDepth(imagen, ptri, GFL_MODE_TO_RGB, GFL_MODE_NO_DITHER)
extGetGflBitmapFromPtr ptri, ima
parametros.FormatIndex = gflGetFormatIndexByName("jpeg")
parametros.Quality = 100
parametros.Progressive = False
parametros.OptimizeHuffmanTable = False
parametros.ChannelOrder = GFL_CTYPE_RGB
Error = gflSaveBitmap("c:\qw.jpg", ima, parametros)
MsgBox CStr(Error) ' Here show me 10
thanks for your help.
Do you use gflGetDefaultLoadParams?
Pierre
Rmgarcia
Post
by Rmgarcia » Fri Jun 25, 2004 10:06 am
But I don´t load any image, I only copy from clipboard. Or I must use gflGetDefaultLoadParams?, How?...
Thanks a lot .
Rafael Martínez García.
xnview
Author of XnView
Posts: 45247 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Fri Jun 25, 2004 10:47 am
Rmgarcia wrote: But I don´t load any image, I only copy from clipboard. Or I must use gflGetDefaultLoadParams?, How?...
Sorry gflGetDefaultSaveParams before gflSaveBitmap
Pierre.
Rmgarcia
Post
by Rmgarcia » Fri Jun 25, 2004 12:00 pm
I try gflGetDefaultSaveParams with variable parametros and I get the same error 10. I don't understand nothing. what's happen?.
Thank yoy very much.
Code: Select all
Dim imagen As GFL_BITMAP
Dim ima As GFL_BITMAP
Dim ptrimagen, ptri As Long
Dim Error As Integer
Dim hoja, diapo, forma, q As Object
Dim ancho, alto As Variant
Dim parametros As GFL_SAVE_PARAMS
Dim Handle As Long
Error = gflImportFromClipboard(ptrimagen)
extGetGflBitmapFromPtr ptrimagen, imagen
Error = gflChangeColorDepth(imagen, ptri, GFL_MODE_TO_RGB, GFL_MODE_NO_DITHER)
extGetGflBitmapFromPtr ptri, ima
gflGetDefaultSaveParams parametros
parametros.FormatIndex = gflGetFormatIndexByName("jpeg")
parametros.Quality = 100
parametros.Progressive = False
parametros.OptimizeHuffmanTable = False
parametros.ChannelOrder = GFL_CTYPE_RGB
Error = gflSaveBitmap("c:\qw.jpg", ima, parametros)
MsgBox CStr(Error)
xnview
Author of XnView
Posts: 45247 Joined: Mon Oct 13, 2003 7:31 am
Location: France
Post
by xnview » Mon Jul 12, 2004 12:26 pm
Could you try:
Rmgarcia wrote: Code: Select all
Error = gflChangeColorDepth(imagen, 0, GFL_MODE_TO_RGB, GFL_MODE_NO_DITHER)
gflGetDefaultSaveParams parametros
parametros.FormatIndex = gflGetFormatIndexByName("jpeg")
parametros.Quality = 100
parametros.Progressive = False
parametros.OptimizeHuffmanTable = False
parametros.ChannelOrder = GFL_CTYPE_RGB
Error = gflSaveBitmap("c:\qw.jpg", imagen, parametros)
MsgBox CStr(Error)
Pierre.