-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPreviewUnit.cpp
53 lines (43 loc) · 1.57 KB
/
PreviewUnit.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "PreviewUnit.h"
#include "OutputScreenUnit.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TPreview *Preview;
//---------------------------------------------------------------------------
__fastcall TPreview::TPreview(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TPreview::Timer1Timer(TObject *Sender)
{
if (!OutputScreen->ouptuScreenUpdated) return;
TRect pictureSize = TRect(0,0,Image1->Width, Image1->Height);
TImage *notActiveImage;
if (Image1->Visible==true) notActiveImage =Image2;
else notActiveImage= Image1;
TImage *activeImage;
if (OutputScreen->Image1->Visible==true) activeImage =OutputScreen->Image1;
else activeImage= OutputScreen->Image2;
notActiveImage->Canvas->StretchDraw(pictureSize, activeImage->Picture->Graphic);
if (Image1->Visible==true)
{
Image2->Visible=true;
Image1->Visible=false;
}
else
{
Image1->Visible=true;
Image2->Visible=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TPreview::FormCreate(TObject *Sender)
{
DoubleBuffered = true;
}
//---------------------------------------------------------------------------