Touchscreen skin (1 Viewer)

dero

Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    Germany Germany
    Hi guys,

    has anyone got a MP-skin usable for a touchscreen?

    I've got a Zalman HD160XT case which comes with a built-in touchscreen (secondary screen). I have a little app running that mirrors the display of the primary screen on the touchscreen (stretchblit) and which forwards mouse clicks on the touchscreen into mouse down/up onto the primary screen.

    But, the default MP-skin is NOT usable with a touchscreen. For example, when I click a button on the home screen, the menu starts to scroll like crazy...

    Regards

    dero
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Hi dero!

    As far as I know there is no special touch-screen skin for MP. But I remember some people using the standard blue two but with home interface instead of the normal interface. But still there's nothing like volume-buttons etc.

    As to stretchblit: Does this program really clone your primary display to your secondary display without messing up your DirectX acceleration on the primary display? I've been looking for something like that a long time...

    thanks,

    Michael
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    Germany Germany
    Hi MJ,

    As far as I know there is no special touch-screen skin for MP. But I remember some people using the standard blue two but with home interface instead of the normal interface. But still there's nothing like volume-buttons etc.

    Then maybe someone should design such a skin... I am quite new to MP, but perhaps I give it a try.

    As to stretchblit: Does this program really clone your primary display to your secondary display without messing up your DirectX acceleration on the primary display? I've been looking for something like that a long time...

    I don't know whether it messes up DirectX acceleration. However, I cannot see any difference. But, it flickers a little bit when you have running something in non-fullscreen (i.e. in the little box at the lower left).

    How to do it:

    You get the DesktopDC using CreateDC('DISPLAY', nil, nil, nil). You bitblt the contents to an offscreen bitmap. You stretchblt this offscreen bitmap to another offscreen bitmap. You blit the result to your window or you get the DesktopDC again and blit directly into the second display. Delphi-Code:

    Code:
        sw := Screen.Monitors[0].Width;
        sh := Screen.Monitors[0].Height;
    
            if ScreenBuffer = nil then
            begin
                ScreenBuffer := TBitmap.Create;
                ScreenBuffer.Width := sw;
                ScreenBuffer.Height := sh;
            end;
    
            if DisplayBuffer = nil then
                DisplayBuffer := TBitmap.Create;
    
            DisplayBuffer.Width := pbDisplay.ClientWidth;
            DisplayBuffer.Height := pbDisplay.ClientHeight;
    
            ScreenBuffer.Canvas.Lock;
            DisplayBuffer.Canvas.Lock;
    
            // scr -> buf
            DesktopDC := CreateDC('DISPLAY', nil, nil, nil);
            try
                BitBlt( ScreenBuffer.Canvas.Handle, 0, 0, ScreenBuffer.Width, ScreenBuffer.Height, DesktopDC, 0, 0, SRCCOPY );
            finally
                DeleteDC( DesktopDC );
            end;
    
            // buf -> dbuf
            PDC := DisplayBuffer.Canvas.Handle;
            if setDisplayHighQuality then SetStretchBltMode( PDC, STRETCH_HALFTONE )
            else SetStretchBltMode( PDC, STRETCH_DELETESCANS );
    
            StretchBlt( PDC, 0, 0, pbDisplay.ClientWidth, pbDisplay.ClientHeight, ScreenBuffer.Canvas.Handle,
                0, 0, sw, sh, SRCCOPY );
    
            // dbuf -> scr
            ul := pbDisplay.ClientToScreen( Point( 0, 0 ) );
    
            PDC := CreateDC('DISPLAY', nil, nil, nil);
            try
                BitBlt( PDC, ul.X, ul.Y, pbDisplay.ClientWidth, pbDisplay.ClientHeight, DisplayBuffer.Canvas.Handle,
                    0, 0, SRCCOPY );
            finally
                DeleteDC( PDC );
            end;
    
            DisplayBuffer.Canvas.Unlock;
            ScreenBuffer.Canvas.Unlock;

    Regards,

    dero
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,478
    1,385
    Hi dero!

    Thanks a lot! This sounds really cool! Unfortunately I won't have the time to do some coding at least for the next two or three weeks. But after that, I'll definately give it a try. (Shouldn't be too hard to translate this into c++ as I have no clue of Delphi at all...)

    Thanks again,

    Michael

    PS: I wouldn't complain if you were the one to start a touch screen skin ;-) Anyways, there are many discussions atm (or should I say rumors of discussions ;-) )about MP NG (new generation) and I guess they will implement this fancy new skinning language (WPF if I don't mix it up with some fancy other MS-abbreviation...) perhaps you should therefore head for this (new) type of skin. Would be a shame if your skin was outdated only a few weeks / months after you finished it...
     

    dero

    Retired Team Member
  • Premium Supporter
  • January 16, 2007
    75
    1
    Home Country
    Germany Germany
    Thanks a lot! This sounds really cool! Unfortunately I won't have the time to do some coding at least for the next two or three weeks. But after that, I'll definately give it a try. (Shouldn't be too hard to translate this into c++ as I have no clue of Delphi at all...)

    It's quite straightforward. Usually, I am working with C++ or Java too. But, for quick'n'dirty applications I always use Delphi.


    PS: I wouldn't complain if you were the one to start a touch screen skin ;-) Anyways, there are many discussions atm (or should I say rumors of discussions ;-) )about MP NG (new generation) and I guess they will implement this fancy new skinning language (WPF if I don't mix it up with some fancy other MS-abbreviation...) perhaps you should therefore head for this (new) type of skin. Would be a shame if your skin was outdated only a few weeks / months after you finished it...

    That's a good point. I am gonna wait...

    Regards

    dero
     

    Users who are viewing this thread

    Top Bottom