Tips and Frequently Asked Questions
Sending and receiving images with TMS MQTT
The following code shows you how to send a selected image to a specific topic on the broker:
procedure TMQTTExampleForm.SetProfilePictureButtonClick(Sender: TObject); var fs: TFileStream; payload: TBytes; begin SelectProfileImageDialog.Filter := ''JPG images|*.jpg''; if (SelectProfileImageDialog.Execute) then begin fs := TFileStream.Create(SelectProfileImageDialog.FileName, fmOpenRead); try SetLength(payload, fs.Size); fs.Read(payload[0], fs.Size); MQTTClient.Publish(''myapp/profile/image'', payload); finally fs.Free; end; end; end;
procedure TMQTTExampleForm.PublishReceived(ASender: TObject; APacketID: Word; ATopic: string; APayload: TBytes); var fs: TBytesStream; begin if (ATopic = ''myapp/profile/image'') then begin fs := TBytesStream.Create(APayload); try fs.SaveToFile(''c:\temp\mqtt\profile-image.jpg''); finally fs.Free; end; end; end;
Pricing
Single Developer License
Small Team License
Site License
TMS MQTT
€ 195
€
80
yearly renewal
license for 1 developer
BEST VALUE
All prices excl. VAT. Renewal price is subject to change and only valid up to 30 days after license has expired. After renewal period a discount price is offered to renew the license.