Page 1 of 1

Store image in string

Posted: Sun Feb 26, 2012 8:20 am
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