CN106843944B - Host container and method for playing Flash in WPF - Google Patents

Host container and method for playing Flash in WPF Download PDF

Info

Publication number
CN106843944B
CN106843944B CN201710004552.3A CN201710004552A CN106843944B CN 106843944 B CN106843944 B CN 106843944B CN 201710004552 A CN201710004552 A CN 201710004552A CN 106843944 B CN106843944 B CN 106843944B
Authority
CN
China
Prior art keywords
window
flash
host container
wpf
win32
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710004552.3A
Other languages
Chinese (zh)
Other versions
CN106843944A (en
Inventor
戴有勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Tianyu Education Technology Co ltd
Original Assignee
Wuhan Tianyu Education Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Tianyu Education Technology Co ltd filed Critical Wuhan Tianyu Education Technology Co ltd
Priority to CN201710004552.3A priority Critical patent/CN106843944B/en
Publication of CN106843944A publication Critical patent/CN106843944A/en
Application granted granted Critical
Publication of CN106843944B publication Critical patent/CN106843944B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)
  • User Interface Of Digital Computer (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a host container and a method for playing Flash in WPF, and relates to the field of Flash playing. The host container is positioned in a WPF window, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, 10% -15% transparency is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect. The invention can not cover other controls when playing Flash.

Description

Host container and method for playing Flash in WPF
Technical Field
The invention relates to the field of Flash playing, in particular to a host container and a method for playing Flash in WPF.
Background
WPF (Windows Presentation Foundation ) is a Microsoft new generation graphic system, operates under NET Framework 3.0 architecture, and provides a unified description and operation method for user interfaces, 2D/3D graphics, documents and media. WPF based on DirectX technology not only brings unprecedented 3D interface, but also its graphics vector rendering engine greatly improves traditional 2D interface. DirectX: direct extenssion, DX, is a multimedia programming interface created by microsoft corporation.
The playing of Flash animation is widely adopted by an official GDI + (Graphics device interface) -based player. When WPF based on DirectX bears Flash based on GDI +, the graphical interface elements rendered based on DirectX and the graphical interface elements rendered based on GDI + are displayed in a same window in a laminated mode. Two rendering technologies are adopted in the same visual area, and a space domain (airspace) problem is generated, namely, layout limitation caused by playing Flash in WPF: the Flash player window (i.e., the Win32 window) covers the WPF window. The support of the WPF on Flash playing is not friendly, only a Win32 component based on GDI + is provided, the WPF is realized through the load bearing of a WPF control host container (Windows FormsHost), a window body is always displayed above a WPF window body during playing and is displayed at the top, and other controls are covered.
Disclosure of Invention
The invention aims to overcome the defects of the background technology and provide a host container and a method for playing Flash in WPF, wherein other controls cannot be covered when the Flash is played.
The invention provides a host container for playing Flash in WPF, wherein the host container is positioned in a WPF window, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, the transparency of 10% -15% is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect.
On the basis of the technical scheme, the host container also realizes interaction by displaying and hiding a Win32 window: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
On the basis of the technical scheme, the interactive operation comprises keyboard operation, mouse operation, stylus operation and gesture operation.
On the basis of the technical scheme, the host container switches and displays the ActiveX control between the Win32 window and the full screen window, and the uninterrupted full screen switching of Flash playing is realized.
On the basis of the technical scheme, the full screen window is a parent window, a bearer or a brand new WPF window of the host container.
The invention also provides a method for playing Flash in WPF based on the host container, which comprises the following steps:
adding a host container in extensible application markup language (XAML) code of a WPF interface; the host container is positioned in a WPF window, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, 10% -15% transparency is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect.
On the basis of the technical scheme, the method further comprises the following steps: the host container realizes interaction by displaying and hiding Win32 windows: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
On the basis of the technical scheme, the interactive operation comprises keyboard operation, mouse operation, stylus operation and gesture operation.
On the basis of the technical scheme, the method further comprises the following steps: and the host container switches and displays the ActiveX control between the Win32 window and the full screen window, so that the uninterrupted full screen switching of Flash playing is realized.
On the basis of the technical scheme, the full screen window is a parent window, a bearer or a brand new WPF window of the host container.
Compared with the prior art, the invention has the following advantages:
(1) the method comprises the steps that a host container is located in a WPF window, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on GDI + (Graphics Device Interface), 10% -15% of transparency is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect. Because the host container sets 10% -15% transparency for the Win32 window, other controls cannot be covered visually, and input events of interactive operations such as keyboard operation, mouse operation, stylus operation and gesture operation cannot be blocked. Therefore, Flash does not cover other controls when playing, the control layout is not limited for the module using Flash, and the method can be applied to the situations that WPF support is incomplete and Win32 has a better processing scheme, such as a web browser, a video player and the like, through extension.
(2) The host container in the invention realizes interaction by displaying and hiding Win32 windows: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
(3) The host container in the invention switches and displays the ActiveX control between the Win32 window and the full screen window, thereby realizing the uninterrupted full screen switching of Flash playing.
(4) The invention displays the screenshot of Flash playing in the Win32 window, which is picture operation, so that the graphical elements of WPF can not be covered, the layout is not influenced, and the control bearing Flash can not conflict with the style of the main window any more.
Drawings
FIG. 1 is a flow chart of the operation of a host container in an embodiment of the invention.
FIG. 2 is a flowchart of Flash interaction in the embodiment of the present invention.
Fig. 3 is a flowchart for implementing uninterrupted full-screen switching of Flash play in the embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the figures and the embodiments.
The embodiment of the invention provides a host container for playing Flash in WPF, the host container is positioned in a WPF window, as shown in figure 1, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic Device Interface GDI + (Graphics Device Interface), the transparency of 10% -15% is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect. As the host container sets 10% -15% transparency for the Win32 window, other controls cannot be covered visually, and input events of interactive operation including keyboard operation, mouse operation, stylus operation and gesture operation cannot be blocked.
The embodiment of the invention also provides a method for playing Flash in WPF based on the host container, which comprises the following steps:
adding a host container in XAML (eXtensible Application Markup Language) code of a WPF interface; the host container is positioned in a WPF window, as shown in figure 1, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, the transparency of 10% -15% is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; and the host container periodically captures the pictures from the Win32 window according to frames, and renders the captured pictures in the host container to form an animation playing effect.
Referring to fig. 2, the host container also interacts by displaying and hiding Win32 windows: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
The host container also switches and displays the ActiveX control between the Win32 window and the full screen window to realize the uninterrupted full screen switching of Flash playing. The reasons for the previous inability to interact are: previously pictures were shown in WPF frames. The embodiment of the invention switches and displays the ActiveX control between the Win32 window and the full screen window.
Referring to fig. 3, when full screen display is required, the host container opens a full screen window, strips the ActiveX control playing Flash from the hidden window, adds the ActiveX control playing Flash in the full screen window for playing, and realizes full screen switching in a mode of not interrupting playing. The full screen frame is a parent frame, a bearer or a brand new WPF frame of the host container.
Various modifications and variations of the embodiments of the present invention may be made by those skilled in the art, and they are also within the scope of the present invention, provided they are within the scope of the claims of the present invention and their equivalents.
What is not described in detail in the specification is prior art that is well known to those skilled in the art.

Claims (6)

1. A host container for playing Flash in WPF is characterized in that: the host container is positioned in a WPF (Windows presentation foundation) window, the host container is added into an XAML (extensible application markup language) code of a WPF interface, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, the transparency of 10% -15% is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; the host container captures a picture from a Win32 window periodically according to frames, and the captured picture is rendered in the host container to form an animation playing effect;
the host container switches and displays an ActiveX control between a Win32 window and a full screen window, so that uninterrupted full screen switching of Flash playing is realized;
the full screen frame is a parent frame, a bearer or a brand new WPF frame of the host container.
2. A WPF Flash-playing host container as claimed in claim 1, wherein: the host container also enables interaction by displaying and hiding Win32 windows: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
3. A WPF Flash-playing host container as claimed in claim 2, wherein: the interactive operation comprises keyboard operation, mouse operation, handwriting pen operation and gesture operation.
4. A method for playing Flash in WPF based on the host container of claim 1, comprising the steps of:
adding a host container in extensible application markup language (XAML) code of a WPF interface; the host container is positioned in a WPF window, the WPF window bears Flash animation through the host container, the host container constructs a Win32 window based on a graphic device interface GDI +, 10% -15% transparency is set for the Win32 window, and other controls cannot be covered visually; loading an ActiveX control on a Win32 window to play Flash; the host container captures a picture from a Win32 window periodically according to frames, and the captured picture is rendered in the host container to form an animation playing effect;
the host container switches and displays an ActiveX control between a Win32 window and a full screen window, so that uninterrupted full screen switching of Flash playing is realized;
the full screen frame is a parent frame, a bearer or a brand new WPF frame of the host container.
5. The method for playing Flash in WPF according to claim 4, wherein: the method further comprises the following steps: the host container realizes interaction by displaying and hiding Win32 windows: when the Flash is played, when a mouse is not in a Flash playing area, the host container sets 0% transparency for a Win32 window, and the Win32 window is completely transparent and supports WPF stacking layout; when the mouse moves into a Flash playing area, the host container sets 10% -15% transparency for a Win32 window, the Win32 window supports capture of input events of interaction operation, interaction between a user and Flash played in the Win32 window is achieved, and interaction effects are presented on the WPF control through screenshot.
6. The method for playing Flash in WPF according to claim 5, wherein: the interactive operation comprises keyboard operation, mouse operation, handwriting pen operation and gesture operation.
CN201710004552.3A 2017-01-04 2017-01-04 Host container and method for playing Flash in WPF Active CN106843944B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710004552.3A CN106843944B (en) 2017-01-04 2017-01-04 Host container and method for playing Flash in WPF

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710004552.3A CN106843944B (en) 2017-01-04 2017-01-04 Host container and method for playing Flash in WPF

Publications (2)

Publication Number Publication Date
CN106843944A CN106843944A (en) 2017-06-13
CN106843944B true CN106843944B (en) 2020-08-25

Family

ID=59118489

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710004552.3A Active CN106843944B (en) 2017-01-04 2017-01-04 Host container and method for playing Flash in WPF

Country Status (1)

Country Link
CN (1) CN106843944B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833447A (en) * 2010-04-08 2010-09-15 广东欧珀移动通信有限公司 Method for realizing desktop Widget animation by using tweening animation
CN102750145A (en) * 2012-06-05 2012-10-24 怯肇乾 Network system software system framework and implementation method thereof
CN104484143A (en) * 2014-12-04 2015-04-01 国家电网公司 Single-data multiple-mode display system for matrix display

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101833447A (en) * 2010-04-08 2010-09-15 广东欧珀移动通信有限公司 Method for realizing desktop Widget animation by using tweening animation
CN102750145A (en) * 2012-06-05 2012-10-24 怯肇乾 Network system software system framework and implementation method thereof
CN104484143A (en) * 2014-12-04 2015-04-01 国家电网公司 Single-data multiple-mode display system for matrix display

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于WPF和FLASH的仿真训练系统可视化设计与实现";邢方元;《中国优秀硕士学位论文全文数据库 信息科技辑》;20141215(第12期);第2.1.2节,第4.6.2节,第5.1节 *

Also Published As

Publication number Publication date
CN106843944A (en) 2017-06-13

Similar Documents

Publication Publication Date Title
US9672539B2 (en) Advertisement generation apparatus and terminal device
US10453240B2 (en) Method for displaying and animating sectioned content that retains fidelity across desktop and mobile devices
US8861890B2 (en) System and method for assembling and displaying individual images as a continuous image
CN110597444B (en) Handwriting display method and device, terminal device and storage medium
US10878175B2 (en) Portlet display on portable computing devices
CN102739983B (en) A kind of method and system realizing translucent effect
US10957285B2 (en) Method and system for playing multimedia data
CN112799627B (en) Display apparatus and image display method
EP2241970A2 (en) System for accelerating composite graphics rendering
US10133711B2 (en) Display apparatus and control method thereof
WO2017113551A1 (en) System and method for operating system of mobile device
US20130127826A1 (en) Parallax image authoring and viewing in digital media
CN112541960A (en) Three-dimensional scene rendering method and device and electronic equipment
CN103049430A (en) Page display method based on IDF (interactive document format) files
JP2017151491A (en) Image display device, image processing system, image processing method, and image processing program
CN106843944B (en) Host container and method for playing Flash in WPF
CN112417346A (en) Rendering method, rendering device, electronic equipment and storage medium
US20150310833A1 (en) Displaying Hardware Accelerated Video on X Window Systems
CN102917272A (en) Method for cross nested display of application program
CN102591646B (en) Method for simultaneously scaling multiple WPF (Windows presentation foundation) windows and device
CN201859394U (en) Gesture control system for dynamic video in projection space
WO2013044417A1 (en) Displaying hardware accelerated video on x window systems
CN110971955A (en) Page processing method and device, electronic equipment and storage medium
US20110175908A1 (en) Image Effect Display Method and Electronic Apparatus Thereof
US9685140B1 (en) Optimized rendering of multimedia content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant