* Using GetPictureVal and Quality encoder _SCREEN.AddProperty("System", NEWOBJECT("xfcSystem", LOCFILE("system.vcx"))) WITH _SCREEN.System.Drawing LOCAL lnJpegQuality lnJpegQuality = 25 LOCAL loBmp as xfcBitmap LOCAL loEncoderParameter AS xfcEncoderParameter LOCAL loEncoderParameters AS xfcEncoderParameters LOCAL loImgFormat as xfcImageFormat loImgFormat = .Imaging.ImageFormat.Jpeg && Create an EncoderParameters object. && An EncoderParameters object has an array of EncoderParameter objects && In this case, there is only one EncoderParameter object in the array. loEncoderParameters = .Imaging.EncoderParameters.New(1) && Save the bitmap as a JPEG file with quality level "lnJpegQuality". && Using an Encoder object based on the GUID && for the Quality parameter category. loEncoderParameter = .Imaging.EncoderParameter.New(.Imaging.Encoder.Quality, lnJpegQuality) loEncoderParameters.Param[1] = loEncoderParameter loBmp = .Bitmap.FromFile(GETPICT()) lcPictVal = loBmp.GetPictureVal(loImgFormat, loEncoderParameters) lnSize = LEN(lcPictVal) MESSAGEBOX("Image size: " + transform(lnSize) + " bytes") * Here you send the PictureVal to the Image object of your form Thisform.Image1.PictureVal = lcPictVal ENDWITHThis 2nd sample is simpler, and uses another function, GETPICTUREVALFROMHBITMAP, that does not need any parameter, and returns the pictureval for BMPs, that are bigger than JPGs from the prior sample.
*Sample 2: * Using GetPictureValfromHBitmap _SCREEN.AddProperty("System", NEWOBJECT("xfcSystem", LOCFILE("system.vcx"))) WITH _SCREEN.System.Drawing LOCAL loBmp as xfcBitmap loBmp = .Bitmap.FromFile(GETPICT()) lcPictVal = loBmp.GetPictureValfromHBitmap() * Here you send the PictureVal to the Image object of your form Thisform.Image1.PictureVal = lcPictVal ENDWITHHope this helps you to get started