historie vjj 1

Podobné dokumenty
Tento materiál byl vytvořen v rámci projektu Operačního programu Vzdělávání pro konkurenceschopnost.

úvod vjj 1

Litosil - application

POPIS TUN TAP. Vysvetlivky: Modre - překlad Cervene - nejasnosti Zelene -poznamky. (Chci si ujasnit o kterem bloku z toho schematu se mluvi.

GUIDELINES FOR CONNECTION TO FTP SERVER TO TRANSFER PRINTING DATA

WYSIWYG EDITOR PRO XML FORM

CZ.1.07/1.5.00/

User manual SŘHV Online WEB interface for CUSTOMERS June 2017 version 14 VÍTKOVICE STEEL, a.s. vitkovicesteel.com

Enterprise Java (BI-EJA) Technologie programování v jazyku Java (X36TJV)

úvod vjj 1

Gymnázium, Brno, Slovanské nám. 7 WORKBOOK. Mathematics. Teacher: Student:

Programování v jazyku C# II. 4.kapitola

Uživatelská příručka. Xperia P TV Dock DK21

Čipové karty Lekařská informatika

Gymnázium a Střední odborná škola, Rokycany, Mládežníků 1115

Introduction to MS Dynamics NAV

Image Analysis and MATLAB. Jiří Militky

Mechanika Teplice, výrobní družstvo, závod Děčín TACHOGRAFY. Číslo Servisní Informace Mechanika:

Střední průmyslová škola strojnická Olomouc, tř.17. listopadu 49

Progressive loyalty V1.0. Copyright 2017 TALENTHUT

Technologie, vlastnosti, uplatnění. Martin Suchan

LOGOMANUÁL / LOGOMANUAL

Java Cvičení 05. CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics

Chapter 7: Process Synchronization

XNA Game Studio 3.1. Tomáš Herceg Microsoft Most Valuable Professional Microsoft Student Partner

Innovated Solution: Questions and Answers after the Webinar

Potřebujete mít vaše IS ve shodě s legislativou? Bc. Stanislava Birnerová

USER'S MANUAL FAN MOTOR DRIVER FMD-02

Instalace Pokyny pro instalaci v operačním systému Windows XP / Vista / Win7 / Win8

UŽIVATELSKÁ PŘÍRUČKA

PV239/WP. Vývoj univerzálních Windows Store aplikací. Mgr. David Gešvindr MCSD: Windows Store MCSE: Data Platform MCT MSP

4Ever H A N D B O O K

Jak importovat profily do Cura (Windows a

Efektivní provoz koncových stanic

Obsah přednášky. GDI+ Tvorba vlastních komponent Vlastní kreslení 1/36

a co je operační systém?

Obsah&/&Content& Všeobecné)podmínky)(v)češtině)) Terms)and)Conditions)(in)english)) )

GUI grafických aplikací GUI pro Othello

WORKSHEET 1: LINEAR EQUATION 1

Automatika na dávkování chemie automatic dosing

CCD 90 MV Cameras (Firewire) CCD 90 MV Cameras (GigE) CCD 90 MV Cameras (USB 2.0)

WL-5480USB. Quick Setup Guide

Czech Republic. EDUCAnet. Střední odborná škola Pardubice, s.r.o.

II/2 Inovace a zkvalitnění výuky cizích jazyků na středních školách

Postup objednávky Microsoft Action Pack Subscription

EU peníze středním školám digitální učební materiál

Projekt: ŠKOLA RADOSTI, ŠKOLA KVALITY Registrační číslo projektu: CZ.1.07/1.4.00/ EU PENÍZE ŠKOLÁM

Social Media a firemní komunikace

ZP4CS 10. hodina Kreslení deskové hry. Aleš Keprt duben 2015

DATA SHEET. BC516 PNP Darlington transistor. technický list DISCRETE SEMICONDUCTORS Apr 23. Product specification Supersedes data of 1997 Apr 16

PC/104, PC/104-Plus. 196 ept GmbH I Tel. +49 (0) / I Fax +49 (0) / I I

Compression of a Dictionary

2011 Jan Janoušek BI-PJP. Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti

Jazyk C# (seminář 3)

EXACT DS OFFICE. The best lens for office work

Kancelářský systém ICE

1, Žáci dostanou 5 klíčových slov a snaží se na jejich základě odhadnout, o čem bude následující cvičení.

Škola: Střední škola obchodní, České Budějovice, Husova 9. Inovace a zkvalitnění výuky prostřednictvím ICT

2 Axiomatic Definition of Object 2. 3 UML Unified Modelling Language Classes in UML Tools for System Design in UML 5

Mobilní malware na platformě Android Přednáška 2. Ing. Milan Oulehla

ROLZ-2. Portable AV/Conference Center. Assembly Instructions

Od Czech POINTu k vnitřní integraci

Petr Vlk KPCS CZ. WUG Days října 2016

IBM Connections pro firmy s Lotus Notes/Domino. Petr Kunc

filtrační polomasky disposable respirators

M-LOCK Magnetický zámek pro křídlové sklněné dveře. M-LOCK Magnetic lock for glass swing doors

M e t o d i c k é p o z n á m k y k z á k l a d o v é m u t e x t u :

Standard VGA (Video Graphics Array)

Britské společenství národů. Historie Spojeného království Velké Británie a Severního Irska ročník gymnázia (vyšší stupeň)

Transportation Problem

MIKROPROCESORY PRO VÝKONOVÉ SYSTÉMY. Stručný úvod do programování v jazyce C 2.díl. České vysoké učení technické Fakulta elektrotechnická

Microsoft Lync WEB meeting

Zubní pasty v pozměněném složení a novém designu

Vývoj univerzálních aplikací pro Windows 10. Mgr. David Gešvindr MCSD: Windows Store MCSE: Data Platform MCT MSP

Nová éra diskových polí IBM Enterprise diskové pole s nízkým TCO! Simon Podepřel, Storage Sales

Office 2007 Styles Autor: Jakub Oppelt Vedoucí práce: Ing. Václav Novák, CSc. Školní rok:

2. Entity, Architecture, Process

Lukáš Kubis. MSP pro VŠB-TU Ostrava

BERGAMO FIRENZE RIMINI. Samozavírače a samozavírací závěsy Floor springs and hinges

VYUŽITÍ DATA DRIVEN PAGES

Windows 10. Availability and experience may vary by market and hardware.

Škola: Střední škola obchodní, České Budějovice, Husova 9. Inovace a zkvalitnění výuky prostřednictvím ICT

Progressive loyalty V1.2. Copyright 2017 TALENTHUT

USING VIDEO IN PRE-SET AND IN-SET TEACHER TRAINING

topter AKTIVNÍ OCHRANA Leading Electrotechnology

Vytvoření pokročilé Fotogalerie v Drupalu - Views

Izolační manipulační tyče typ IMT IMT Type Insulated Handling Rod

Programy pro OS Windows

TechoLED H A N D B O O K

PAINTING SCHEMES CATALOGUE 2012

Introduction to Navision 4.00 Jaromír Skorkovský, MS., PhD.

Firemní strategie pro správu mobilních zařízení, bezpečný přístup a ochranu informací. Praha 15. dubna 2015

Tento materiál byl vytvořen v rámci projektu Operačního programu Vzdělávání pro konkurenceschopnost.

Střední průmyslová škola strojnická Olomouc, tř.17. listopadu 49

POWERSHELL. Desired State Configuration (DSC) Lukáš Brázda MCT, MCSA, MCSE

Aplikační inteligence a identity management jako základ bezpečné komunikace

By David Cameron VE7LTD

Digitální učební materiál

Evaluace přenosu znalostí v kyberprostoru

Systém pro správu experimentálních dat a metadat. Petr Císař, Antonín Bárta 2014 Ústav komplexních systémů, FROV, JU

Transkript:

historie 08.11.2018 vjj 1

08.11.2018 vjj 2 pravěk INPUT PROGRAM OUTPUT

08.11.2018 vjj 3 dávkové zpracování evoluce interaktivní práce prompt GUI

08.11.2018 vjj 4 evoluce INPUT PROGRAM OUTPUT

08.11.2018 vjj 5 evoluce Windows bitmap graphics model - Device Context Windows does not retain a copy of what the application drew Windows 3.0 (1990) bitmap graphics model - layered Device Context Windows does retain a copy of the drawing as a bitmap Windows 2000 (beta 1998).NET Framework (2001-2005) vector graphics model WPF (on DirectX) tree of user-interface elements with objects representing graphical shapes Windows Vista,.NET Framework 3.0 (2006) Metro - deterioration Windows 8,.NET Framework 4.5 (2012)

08.11.2018 vjj 6 1: Win32 API classique

8.11.18 vjj 7 Uživatel (mouse, keyboard) Fronta zpráv GetMessage hardware interrupt DRIVER DispatchMessage System message queue RIT Raw Input Thread WindowProc WindowProc Fronta zpráv

08.11.2018 vjj 8 WM_PAINT každý ovládací prvek je samostatným oknem s vlastní procedurou na zpracovávání zpráv celá stavba programu/algoritmu se točila kolem přípravy dat pro vykreslení obsahu okna vždy, když přišla zpráva WM_PAINT (a že chodila často) během přímého kreslení se výstup do momentálně neviditelné části okna nikam nezapsal

08.11.2018 vjj 9 User Windows OS Invalidate... Program WM_PAINT GetDC Program Funkce GDI32 / GDI+ Graphics Card Frame Buffer for Screen Image data only retained as long as it remains visible on screen

08.11.2018 vjj 10 PROGRAM: direct Device Context OUTPUT PROGRAM WM_PAINT PROGRAM WM_PAINT PROGRAM WM_PAINT PROGRAM WM_PAINT PROGRAM WM_PAINT

08.11.2018 vjj 11 standardní funkce TextOut DrawText DrawIcon BitBlt stretchblt MoveToEx LineTo Rectangle Ellipse Pie Arc Chord Polyline Polygon

08.11.2018 vjj 12 Device Context standardní funkce pro kreslení do okna vyžadují hdc jako svůj první parametr datová struktura popisující vlastnosti výstupu, např. font text pero čárová grafika štětec pozadí Update Region hdc z funkcí BeginPaint, GetDC,... CS_CLASSDC, CS_OWNDC

08.11.2018 vjj 13 bitmap graphics model each UI element (HWND) has exclusive ownership of some region of the application's window within each top-level window, any given pixel in that window is controlled completely by exactly one UI element this prevents elements from being partially transparent it also preludes the use of anti-aliasing around the edges of elements

08.11.2018 vjj 29 TextOut TextOut (hdc, x, y, "text", délka) ; SetTextAlign (hdc, TA_LEFT TA_TOP) ; TA_RIGHT TA_BOTTOM TA_CENTER TA_NOUPDATECP TA_UPDATECP SetTextColor (hdc, dwcolorrgb) ; RGB (255, 255, 255) dwcolorrgb = GetTextColor (hdc) ;

08.11.2018 vjj 34 Čárová grafika MoveToEx (hdc, dox, doy, NULL) ; LineTo (hdc, dox, doy) ; Rectangle (hdc, leftx, topy, rightx, bottomy) ; Ellipse (hdc, leftx, topy, rightx, bottomy) ; Pie (hdc, leftx, topy, rightx, bottomy, x3, y3, x4, y4) ; Arc (hdc, leftx, topy, rightx, bottomy, x3, y3, x4, y4) ; Chord(hDC, leftx, topy, rightx, bottomy, x3, y3, x4, y4); Polyline (hdc, CONST POINT *lppoints, int npočet) ; Polygon (hdc, CONST POINT *lppoints, int npočet) ; SetPolyFillMode (hdc, ALTERNATE nebo WINDING);

Bitmap 08.11.2018 vjj 43

08.11.2018 vjj 70 2: layered window Win32 API upgrade

08.11.2018 vjj 71 layered window Windows WM_PAINT Program Funkce GDI32 / GDI+ off-screen Layered Window Buffer Desktop Compositing Engine (DCE) Graphics Card Frame Buffer for Screen

08.11.2018 vjj 77 2½: Windows.Forms 1st generation of.net

08.11.2018 vjj 78.NET GDI Graphics Model Aplikace Drawing Objects Funkce GDI32 / GDI+ Buffer for the Window Windows.NET runtime Funkce GDI32 / GDI+ off-screen Layered Window Buffer Desktop Window Manager (DWM) Graphics Card Buffer

3: DirectX 08.11.2018 vjj 86

3½: WPF 08.11.2018 vjj 88

08.11.2018 vjj 89 Desktop Window Manager DWM.EXE http://en.wikipedia.org/wiki/desktop_window_manager

08.11.2018 vjj 90 window undercoat DWM window with non-rectangular area window chrome window without title bar window content GDI, DirectX (WPF) window composition partial transparency, blur, outer glow, anti-aliasing

08.11.2018 vjj 91 DWM It was originally created to enable portions of the "Windows Aero" user experience (Windows Vista, Windows 7), which allowed for effects such as transparency, 3D window switching and more it has been subsequently severely reduced, blocked - with advent of Windows 8 severely reduced, code removed Windows 8, 8.1 partially revived several updates of Windows 10

window chrome 08.11.2018 vjj 92

08.11.2018 vjj 93 with UI chrome WindowStyle="ThreeDBorderWindow"

08.11.2018 vjj 94 without UI chrome WindowStyle="None"

non-rectangular window 08.11.2018 vjj 95

08.11.2018 vjj 96 Win32 API SetWindowRgn SetWindowPos (hmymainwindow, 0, 100, 100, 800, 400, SWP_NOZORDER) ; rg1 = CreateEllipticRgn (0, -400, 800, 400) ; rg2 = CreateRectRgn (0, 0, 800, 400) ; CombineRgn (rg1, rg1, rg2, RGN_AND) ; rg2 = CreateEllipticRgn (500, 50, 700, 150) ; CombineRgn (rg1, rg1, rg2, RGN_DIFF) ; SetWindowRgn (hmymainwindow, rg1, TRUE) ;

Win32 API SetWindowRgn 08.11.2018 vjj 97

08.11.2018 vjj 98 WPF VisualClip this.visualclip = new EllipseGeometry (new Rect(new Point(0, 0), new Size(400, 400)));

08.11.2018 vjj 99 WPF VisualClip WindowStyle="ThreeDBorderWindow"

08.11.2018 vjj 100 WindowStyle="None" WPF VisualClip

08.11.2018 vjj 101 AllowsTransparency <Window x:class="glassw.window1" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" AllowsTransparency="True" WindowStyle="None"> requires WindowStyle="None AllowsTransparency cannot be changed after a Window has been shown or WindowInteropHelper.EnsureHandle has been called

08.11.2018 vjj 102 WindowStyle="None" WPF AllowsTransparency="True"

window opacity 08.11.2018 vjj 103

08.11.2018 vjj 104 Opacity="0.4" Opacity

08.11.2018 vjj 105 Opacity WindowStyle="None" AllowsTransparency="True" Background="Transparent"

08.11.2018 vjj 106 Aero blur DwmIsCompositionEnabled DwmExtendFrameIntoClientArea DwmEnableBlurBehindWindow

08.11.2018 vjj 107 Aero blur <Window x:class="glassw.window1" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" AllowsTransparency="False" WindowStyle="None" Background="Transparent"> requires desktop Aero Theme

DwmExtendFrameIntoClientArea 08.11.2018 vjj 108

DwmExtendFrameIntoClientArea 08.11.2018 vjj 109

DwmExtendFrameIntoClientArea 08.11.2018 vjj 110

08.11.2018 vjj 111 DwmExtendFrameIntoClientArea public class GlassHelper { [StructLayout(LayoutKind.Sequential)] struct MARGINS { public MARGINS( Thickness t ) { Left = (int)t.left; Right = (int)t.right; Top = (int)t.top; Bottom = (int)t.bottom; } public int Left; public int Right; public int Top; public int Bottom; } // P/Invoke [DllImport("dwmapi.dll", PreserveSig = false)] static extern void DwmExtendFrameIntoClientArea( IntPtr hwnd, ref MARGINS pmarinset); [DllImport("dwmapi.dll", PreserveSig = false)] static extern bool DwmIsCompositionEnabled();

08.11.2018 vjj 112 DwmExtendFrameIntoClientArea public static bool ExtendGlassFrame( System.Windows.Window window, Thickness margin) { IntPtr hwnd = new WindowInteropHelper( window ).Handle; if (hwnd == IntPtr.Zero) return false; if (! DwmIsCompositionEnabled() ) return false; MARGINS margins = new MARGINS( margin ); DwmExtendFrameIntoClientArea( hwnd, ref margins ); } return true; } // class GlassHelper

08.11.2018 vjj 113 DwmExtendFrameIntoClientArea private void mybackgroundvisibility_unchecked( object sender, RoutedEventArgs e) { // Set the WPF background to transparent this.background = Brushes.Transparent; } // Set the Win32 background to transparent IntPtr hwnd = new WindowInteropHelper(this).Handle; if (hwnd == IntPtr.Zero) return; HwndSource.FromHwnd(hwnd).CompositionTarget.BackgroundColor = Colors.Transparent;

DwmEnableBlurBehindWindow 08.11.2018 vjj 114

08.11.2018 vjj 115 DwmEnableBlurBehindWindow [DllImport("dwmapi.dll", PreserveSig = false)] static extern void DwmEnableBlurBehindWindow( IntPtr hwnd, ref DWM_BLURBEHIND pblurbehind); [StructLayout(LayoutKind.Sequential)] struct DWM_BLURBEHIND { public DWM_BB dwflags; public bool fenable; public IntPtr hrgnblur; public bool ftransitiononmaximized; public DWM_BLURBEHIND(bool enabled) { fenable = enabled? true : false; hrgnblur = IntPtr.Zero; ftransitiononmaximized = false; dwflags = DWM_BB.Enable; } DWM_BLURBEHIND bb = new DWM_BLURBEHIND(bbb); DwmEnableBlurBehindWindow(hwnd, ref bb);

WPF 08.11.2018 vjj 116

08.11.2018 vjj 118 WPF zjednodušení stromové struktury oken, ze kterých se skládá UI aplikace všechny ovládací prvky uvnitř okna už nejsou samostatnými okny, ale jen ilustracemi o rozlišení událostí, které se jich týkají, se místo jádra Windows (vlákno RAW) stará.net runtime (tj. DLL uvnitř Win32 API aplikace hostující.net, která zpracovává Win32 API zprávy) Metro šlo ve zjednodušení stromové struktury oken ještě dál - runtime + všechny apps = jediný Win32 API proces s jediným oknem (full screen)

08.11.2018 vjj 119 WPF Graphics Model Windows Presentation Foundation (Avalon) nadstavba nad DirectX HW akcelerace transformace jsou aplikovány na libovolnou část vizuálního stromu, tj. ne pouze na kompletní uživatelskou oblast okna jako u Win32 API nezávislé na hardwaru a na rozlišení vždy vektorové jednotky: "device-independent pixels" = 1/96 th of an inch výpočty - float WPF Windows are based on old fashioned Win32 window objects. The frame (even the modern Vista frame) is rendered by GDI/GDI+. Only the client area is done by WPF itself o vykreslování kompletních oken na desktop se stará Desktop Window Manager

08.11.2018 vjj 120 borders - WindowStyle.NET 4.5, 4.6 ve Windows 7

DWM basics 08.11.2018 vjj 121

08.11.2018 vjj 122 W7 Graphics Model Program UI Chrome Visual Objects Media Integration Layer (MIL) funkce DirectX Graphics Card Buffer for the Window DWM - MIL GDI Frame Windows Funkce DirectX Graphics Card Buffer for the Screen

08.11.2018 vjj 123 Desktop Window Manager Desktop Window Manager (DWM, previously Desktop Compositing Engine or DCE) is the desktop graphical user interface system in Windows Vista, 7 that enables the Windows Aero graphical user interface and visual theme. The Desktop Window Manager requires video cards supporting DirectX 9.0 and Shader Model 2.0.

08.11.2018 vjj 124 DWM visual effects Windows 7 desktop composition is enabled only with the AERO Glass Theme Windows Flip, automatic scaling for high resolution (DPI) scaling, thumbnail previews, and full screen magnifier Windows 8 AERO Glass composition is removed desktop composition for all themes, support for Stereoscopic 3D, and management, separation, and protection of the experience with Windows Store apps Windows Flip, automatic scaling for high resolution (DPI) scaling, thumbnail previews, and full screen magnifier

Windows flip 08.11.2018 vjj 125

08.11.2018 vjj 126 DWM visual effects transparency of the non-client region of a window transition effects rounded window corners Glass sheet Glow around caption buttons Transparent background to title bar text (In Windows 8.1, the background text was drawn over an opaque background which is the same color as the personalization color chosen by the user. This restricts theme assets from being anything other than 100% transparent, otherwise the text displays incorrectly) Title bar text glow

08.11.2018 vjj 127 system chrome The 'system chrome' include the non-client area of all desktop windows, which DWM (as the desktop compositor) is completely responsible for. The code for rendering window borders (including things like the colorized regions, aka the glass regions) are all a part of the udwm component. An application may override this behavior by handling the WM_NCPAINT message, but it is otherwise rendered entirely by DWM making use of the system theme resources as necessary. It is also responsible for rendering glass regions that the user draws in the client area either via the adjustment of border margins, or via rendering of shapes using a color key for said regions.

08.11.2018 vjj 128 off-screen buffer The Desktop Window Manager is a Compositing window manager, each program has an off-screen buffer that it writes data to, the DWM then composites each program's buffer into a final image, and redraws windows when necessary. compared to the stacking window manager in Windows XP and earlier (and Windows 7 and Vista with Aero disabled) which has each program writing to the same main buffer.

08.11.2018 vjj 130 DirectX compositing and rendering Because the compositor has access to the graphics of all applications, it easily allows visual effects that string together visuals from multiple applications, such as transparency. The DWM uses DirectX to perform the function of compositing and rendering in the GPU, freeing the CPU of the task of managing the rendering from the offscreen buffers to the display. However, it does not affect applications painting to the offscreen buffers; depending on the technologies used for that, it might still be CPU-bound.

08.11.2018 vjj 131 DirectX compositing and rendering DWM-agnostic rendering techniques like GDI are redirected to the buffers by rendering the UI as bitmaps. DWM-aware rendering technologies like WPF directly make the internal data structures available in a DWM-compatible format. The window contents in the buffers are then converted to DirectX textures.

08.11.2018 vjj 132 desktop and windows The desktop itself is a full-screen Direct3D surface, with windows being represented as a mesh consisting of two adjacent (and mutually-inverted) triangles, which are transformed to represent a 2D rectangle. The texture, representing the UI chrome, is then mapped onto these rectangles.

08.11.2018 vjj 133 DWM possibilities underlying Direct3D surface default black rectangle (AllowsTransparency = "False") transparent (AllowsTransparency = "True" WindowStyle = "None") blur (DwmEnableBlurBehindWindow) chrome (WindowStyle = "ThreeDBorderWindow") blured - Window Style Aero frame extended into a client area (DwmExtendFrameIntoClientArea)

08.11.2018 vjj 134 desktop and windows Window transitions are implemented as transformations of the meshes, using shader programs. With Windows Vista, the transitions are limited to the set of built-in shaders that implement the transformations. Greg Schechter, a developer at Microsoft has suggested that it might be opened up for developers and users to plug in their own effects in a future release. The DWM only maps the primary desktop object as a 3D surface; other desktop objects, including virtual desktops as well as the secure desktop used by User Account Control are not.

08.11.2018 vjj 135 using the off-screen buffer Since all applications render to an off-screen buffer, they can be read off the buffer embedded in other applications as well. Since the off-screen buffer is constantly updated by the application, the embedded rendering will be a dynamic representation of the application window and not a static rendering. This is how the live thumbnail previews, Windows Flip and Windows Flip 3D work in Windows Vista. The DWM exposes a public API that allows applications to access these thumbnail representations. The size of the thumbnail is not fixed; applications can request the thumbnails at any size - smaller than the original window, at the same size or even larger - and DWM will scale them properly before returning. Windows Flip 3D uses the thumbnail APIs to get the window representations as bitmaps, and then uses that as texture for 2D rectangles, which are further processed by custom shaders to transform them to 3D meshes and rotate them in a 3D plane.

08.11.2018 vjj 136 DWM thumbnail API HRESULT hr = S_OK; HTHUMBNAIL thumbnail = NULL; // Register the thumbnail hr = DwmRegisterThumbnail(hwnd, FindWindow(_T("Progman"), NULL), &thumbnail); if (SUCCEEDED(hr)) { // Specify the destination rectangle size RECT dest = {0,50,100,150}; // Set the thumbnail properties for use DWM_THUMBNAIL_PROPERTIES dskthumbprops; dskthumbprops.dwflags = DWM_TNP_SOURCECLIENTAREAONLY DWM_TNP_VISIBLE DWM_TNP_OPACITY DWM_TNP_RECTDESTINATION; dskthumbprops.fsourceclientareaonly = FALSE; dskthumbprops.fvisible = TRUE; dskthumbprops.opacity = (255 * 70)/100; dskthumbprops.rcdestination = dest; // Display the thumbnail hr = DwmUpdateThumbnailProperties(thumbnail,&dskThumbProps); if (SUCCEEDED(hr)) { //... } } return hr;