Store image in string

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: XnTriq, helmut, xnview

sct|nsky
Posts: 16
Joined: Sun Mar 21, 2010 1:20 pm

Store image in string

Post by sct|nsky »

I want to store an image in a string so i can send it through a winsock.
Can i use the "ctrl.SendBinary" ? or how could i get the image into an string?

Code: Select all

Set ctrl = New GflAx.GflAx
ctrl.LoadBitmap App.Path & "\" & fileName

if ctrl.OriginalHeight < ctrl.OriginalWidth Then
   ctrl.Resize 160, ctrl.OriginalHeight * 160 / ctrl.OriginalWidth
Else
   ctrl.Resize 160, ctrl.OriginalHeight * 160 / ctrl.OriginalWidth
   ctrl.Crop 0, (ctrl.OriginalHeight * 160 / ctrl.OriginalWidth) / 2 - 60, 160, 120
End If
ctrl.Sharpen 60
ctrl.SaveJPEGProgressive = True 
ctrl.SaveJPEGQuality = 60

someString = ctrl.SendBinary

Set ctrl = Nothing