Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
734d16a2
Kaydet (Commit)
734d16a2
authored
Kas 07, 2014
tarafından
Michael Meeks
Kaydeden (comit)
Markus Mohrhard
Kas 10, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcldemo: more interesting pieces, DrawPoint, DrawTransparent and more.
Change-Id: I77c6e5c54a9d0e71014e8c7905132a56e39a302a
üst
9a2cf089
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
vcldemo.cxx
vcl/workben/vcldemo.cxx
+56
-0
No files found.
vcl/workben/vcldemo.cxx
Dosyayı görüntüle @
734d16a2
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#if 0
#if 0
# define FIXME_ALPHA_WORKING
# define FIXME_ALPHA_WORKING
# define FIXME_ROUNDED_RECT_WORKING
# define FIXME_ROUNDED_RECT_WORKING
# define FIXME_DRAW_TRANSPARENT_WORKING
#endif
#endif
using
namespace
css
;
using
namespace
css
;
...
@@ -85,6 +86,17 @@ public:
...
@@ -85,6 +86,17 @@ public:
DrawLine
(
Point
(
r
.
Left
(),
r
.
Top
()
+
i
),
Point
(
r
.
Right
(),
r
.
Bottom
()
-
i
)
);
DrawLine
(
Point
(
r
.
Left
(),
r
.
Top
()
+
i
),
Point
(
r
.
Right
(),
r
.
Bottom
()
-
i
)
);
for
(
int
i
=
0
;
i
<
r
.
GetWidth
();
i
+=
15
)
for
(
int
i
=
0
;
i
<
r
.
GetWidth
();
i
+=
15
)
DrawLine
(
Point
(
r
.
Left
()
+
i
,
r
.
Bottom
()),
Point
(
r
.
Right
()
-
i
,
r
.
Top
())
);
DrawLine
(
Point
(
r
.
Left
()
+
i
,
r
.
Bottom
()),
Point
(
r
.
Right
()
-
i
,
r
.
Top
())
);
// Should draw a white-line across the middle
Color
aLastPixel
(
COL_WHITE
);
Point
aCenter
((
r
.
Left
()
+
r
.
Right
())
/
2
-
4
,
(
r
.
Top
()
+
r
.
Bottom
())
/
2
-
4
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
DrawPixel
(
aCenter
,
aLastPixel
);
aLastPixel
=
GetPixel
(
aCenter
);
aCenter
.
Move
(
1
,
1
);
}
}
}
void
drawText
(
Rectangle
r
)
void
drawText
(
Rectangle
r
)
...
@@ -150,6 +162,49 @@ public:
...
@@ -150,6 +162,49 @@ public:
aSemiTransp
));
aSemiTransp
));
#else
#else
DrawBitmapEx
(
r
.
TopLeft
(),
aBitmap
);
DrawBitmapEx
(
r
.
TopLeft
(),
aBitmap
);
#endif
}
void
drawPolyPolgons
(
Rectangle
r
)
{
struct
{
double
nX
,
nY
;
}
aPoints
[]
=
{
{
0.1
,
0.1
},
{
0.9
,
0.9
},
{
0.9
,
0.1
},
{
0.1
,
0.9
},
{
0.1
,
0.1
}
};
tools
::
PolyPolygon
aPolyPoly
;
// Render 4x polygons & aggregate into another PolyPolygon
for
(
int
x
=
0
;
x
<
2
;
x
++
)
{
for
(
int
y
=
0
;
y
<
2
;
y
++
)
{
Rectangle
aSubRect
(
r
);
aSubRect
.
Move
(
x
*
r
.
GetWidth
()
/
3
,
y
*
r
.
GetHeight
()
/
3
);
aSubRect
.
SetSize
(
Size
(
r
.
GetWidth
()
/
2
,
r
.
GetHeight
()
/
4
));
Polygon
aPoly
(
SAL_N_ELEMENTS
(
aPoints
));
for
(
size_t
v
=
0
;
v
<
SAL_N_ELEMENTS
(
aPoints
);
v
++
)
{
aPoly
.
SetPoint
(
Point
(
aSubRect
.
Left
()
+
aSubRect
.
GetWidth
()
*
aPoints
[
v
].
nX
,
aSubRect
.
Top
()
+
aSubRect
.
GetHeight
()
*
aPoints
[
v
].
nY
),
v
);
}
SetLineColor
(
Color
(
COL_YELLOW
));
SetFillColor
(
Color
(
COL_BLACK
));
DrawPolygon
(
aPoly
);
// now move and add to the polypolygon
aPoly
.
Move
(
0
,
r
.
GetHeight
()
/
2
);
aPolyPoly
.
Insert
(
aPoly
);
}
}
SetLineColor
(
Color
(
COL_LIGHTRED
));
SetFillColor
(
Color
(
COL_GREEN
));
#ifdef FIXME_DRAW_TRANSPARENT_WORKING
DrawTransparent
(
aPolyPoly
,
50
);
#else
DrawPolyPolygon
(
aPolyPoly
);
#endif
#endif
}
}
void
fetchDrawBitmap
(
Rectangle
r
)
void
fetchDrawBitmap
(
Rectangle
r
)
...
@@ -217,6 +272,7 @@ void DemoWin::Paint( const Rectangle& rRect )
...
@@ -217,6 +272,7 @@ void DemoWin::Paint( const Rectangle& rRect )
drawBitmapEx
(
aRegions
[
i
++
]);
drawBitmapEx
(
aRegions
[
i
++
]);
drawBitmap
(
aRegions
[
i
++
]);
drawBitmap
(
aRegions
[
i
++
]);
drawGradient
(
aRegions
[
i
++
]);
drawGradient
(
aRegions
[
i
++
]);
drawPolyPolgons
(
aRegions
[
i
++
]);
// last - thumbnail all the above
// last - thumbnail all the above
fetchDrawBitmap
(
aRegions
[
i
++
]);
fetchDrawBitmap
(
aRegions
[
i
++
]);
assert
(
i
<=
12
);
assert
(
i
<=
12
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment