Affichage des résultats 1 à 44 sur 44
Discussion: ED-SDK 2.7 En Delphi
Vue hybride
-
11/10/2015, 22h13 #1
- Inscription
- October 2015
- Localisation
- Denmark
- Âge
- 65
- Messages
- 2
- Boîtier
- Canon EOS 1000D
- Objectif(s)
- Skilled in Optics and Delphi programming
I stiil think the code in CCP_0.0.30_C078D67F.rar is interesting for a lot of Delphi programmers working with the Canon SDK and the Canon EOS cameraes.
It was still straight forward to compile the code in Delphi XE7. However, playing around with LiveView made it end up in dead locks. I did fix this by making a few changes to the code in the unit ThreadLiveViewStream.pas. Please notice the added synchronize command.
unit ThreadLiveViewStream;
interface
uses
Classes, CanonCamera, ExtCtrls;
type
TLiveViewStream = class(TThread)
private
{ Déclarations privées }
FCamera: TCanonCamera;
FImage: TImage;
FStatus : Boolean;
protected
procedure DownloadNextLVI;
procedure Execute; override;
public
property Status : Boolean read FStatus;
constructor Create(Camera: TCanonCamera; Image: TImage; CreateSuspended: Boolean = True);
end;
implementation
{ TLiveViewStream }
constructor TLiveViewStream.Create(Camera: TCanonCamera; Image: TImage; CreateSuspended: Boolean = True);
begin
Self.FCamera := Camera;
Self.FImage := Image;
Self.FStatus := False;
Inherited Create(CreateSuspended);
end;
//har selv oprettet denne for at udføre Synchronize
procedure TLiveViewStream.DownLoadNextLVI;
begin
Self.FStatus := FCamera.DownloadLiveViewImage(FImage); //Lecture et affichage du stream dans l'objet
end;
procedure TLiveViewStream.Execute;
begin
if not FCamera.IsInLiveView Then //demare le LV
Exit;
Self.Priority := tpLower; //tpHigher should be tpLower according to the Delphi Help
repeat
try
//FStatus := FCamera.DownloadLiveViewImage(FImage); //Lecture et affichage du stream dans l'objet
Synchronize(DownloadNextLVI); //Did add Synchronize on 11-10-2015 to prevent dead locks
except
FStatus := False;
end;
until Terminated;
End;
end.
Informations de la discussion
Utilisateur(s) sur cette discussion
Il y a actuellement 1 utilisateur(s) naviguant sur cette discussion. (0 utilisateur(s) et 1 invité(s))