| 1 |
{ |
| 2 |
Copyright 2017-2024 Michalis Kamburelis and Jan Adamec. |
| 3 |
|
| 4 |
This file is part of "Castle Game Engine". |
| 5 |
|
| 6 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 7 |
included in this distribution, for details about the copyright. |
| 8 |
|
| 9 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 |
|
| 13 |
---------------------------------------------------------------------------- |
| 14 |
} |
| 15 |
|
| 16 |
{ Operating system Photo library integration (TPhotoService). } |
| 17 |
unit CastlePhotoService; |
| 18 |
|
| 19 |
{$I castleconf.inc} |
| 20 |
|
| 21 |
interface |
| 22 |
|
| 23 |
uses Classes; |
| 24 |
|
| 25 |
type |
| 26 |
{ TPhotoService enables to store/retrieve images to/from the system Photos |
| 27 |
app. It may also request user to take a new photo with the camera. |
| 28 |
|
| 29 |
At the moment, only storing images is implemented. |
| 30 |
} |
| 31 |
TPhotoService = class(TComponent) |
| 32 |
public |
| 33 |
class procedure StoreImage(APath: string); |
| 34 |
end; |
| 35 |
|
| 36 |
implementation |
| 37 |
|
| 38 |
uses CastleMessaging, CastleUriUtils; |
| 39 |
|
| 40 |
class procedure TPhotoService.StoreImage(APath: string); |
| 41 |
begin |
| 42 |
Messaging.Send([ |
| 43 |
'photoservice-store-image', |
| 44 |
APath, |
| 45 |
UriMimeType(APath) |
| 46 |
]); |
| 47 |
end; |
| 48 |
|
| 49 |
end. |