Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6f18addb
Commit
6f18addb
authored
Sep 17, 2009
by
Pierre Ynard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32text: add multiline support
parent
797d3efe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
modules/misc/win32text.c
modules/misc/win32text.c
+8
-7
No files found.
modules/misc/win32text.c
View file @
6f18addb
/*****************************************************************************
* win32text.c : Text drawing routines using the TextOut win32 API
*****************************************************************************
* Copyright (C) 2002 - 200
5
the VideoLAN team
* Copyright (C) 2002 - 200
9
the VideoLAN team
* $Id$
*
* Authors: Gildas Bazin <gbazin@videolan.org>
* Pierre Ynard
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -302,8 +303,7 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
int
i
,
i_width
,
i_height
;
HBITMAP
bitmap
,
bitmap_bak
;
BITMAPINFO
*
p_bmi
;
RECT
rect
=
{
0
};
SIZE
size
;
RECT
rect
=
{
0
,
0
,
0
,
0
};
/* Sanity check */
if
(
!
p_region_in
||
!
p_region_out
)
return
VLC_EGENERIC
;
...
...
@@ -344,8 +344,9 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
SetTextColor
(
p_sys
->
hcdc
,
RGB
(
(
i_font_color
>>
16
)
&
0xff
,
(
i_font_color
>>
8
)
&
0xff
,
i_font_color
&
0xff
)
);
GetTextExtentPoint
(
p_sys
->
hcdc
,
psz_string
,
_tcslen
(
psz_string
),
&
size
);
i_width
=
rect
.
right
=
size
.
cx
;
i_height
=
rect
.
bottom
=
size
.
cy
;
DrawText
(
p_sys
->
hcdc
,
psz_string
,
-
1
,
&
rect
,
DT_CALCRECT
|
DT_CENTER
|
DT_NOPREFIX
);
i_width
=
rect
.
right
;
i_height
=
rect
.
bottom
;
p_bmi
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
sizeof
(
RGBQUAD
)
*
16
);
memset
(
p_bmi
,
0
,
sizeof
(
BITMAPINFOHEADER
)
);
...
...
@@ -376,8 +377,8 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
bitmap_bak
=
SelectObject
(
p_sys
->
hcdc
,
bitmap
);
FillRect
(
p_sys
->
hcdc
,
&
rect
,
(
HBRUSH
)
GetStockObject
(
BLACK_BRUSH
)
);
//TextOut( p_sys->hcdc, 0, 0, psz_string, strlen(psz_string) );
if
(
!
DrawText
(
p_sys
->
hcdc
,
psz_string
,
-
1
,
&
rect
,
0
)
)
if
(
!
DrawText
(
p_sys
->
hcdc
,
psz_string
,
-
1
,
&
rect
,
DT_CENTER
|
DT_NOPREFIX
)
)
{
msg_Err
(
p_filter
,
"could not draw text"
);
}
...
...
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