Author Topic: KVideoPlayer API (madVR interface)  (Read 7585 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #330 on: November 13, 2017, 10:24:25 am »
The popup layered window used to render the sprite must use the same Instance than the main window application.

However the sprites do not require a parent,  they just have to be rendered onto the popup layered DC when needed.
Try to do the same than in OTB, exactly.

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #331 on: November 13, 2017, 10:49:52 am »
ok thanks..  8)

greets

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #332 on: November 14, 2017, 03:09:45 am »
Patrice,
Have no idea what to do with it (TMD_MoveIconUpDown)

ZD_GetObjectXY(ID_RECT, nX, nY);
ZD_SetObjectXY
ZD_SetObjectVisibility

please can you explain that to me?
so i can find a solution for that.

ZD_GetObjectBound(ID_RIGHT_ARROW, nW, nH);
seems to work that way..
ID_RIGHT is the Sprite ID for the Left_arrow.png (Object)

Code: [Select]
    Sprite := Sprites[ID_RIGHT];
    nW := Sprite.Width;
    nH := Sprite.Height;

greets

« Last Edit: November 15, 2017, 03:12:30 pm by Emil Weiss »

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #333 on: November 14, 2017, 08:31:54 am »
Emil

Quote
your tell me Sprite Window not use a Parent?
I was speaking of this for OTB !
Now if we speak of the TMD.h, the parent of the sprites, is the GDImage popup gP.hContact graphic container.

Quote
Have no idea what to do with it (TMD_MoveIconUpDown)

ZD_GetObjectXY(ID_RECT, nX, nY);
ZD_SetObjectXY
ZD_SetObjectVisibility

please can you explain that to me?
so i can find a solution for that.
See the attached GDImage.chm file documentation, that should help you to understand what is going on.
And for what you are asking about, look at the "Drawing procedures" section.


« Last Edit: November 14, 2017, 09:48:19 am by Patrice Terrier »

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #334 on: November 14, 2017, 08:57:57 am »
The TMD gP.hContact is a popup window, populated with multiple GDImage objects (sprites)

This is the order of the ZOBJECT(s).
1 - The background (the movie wallpaper) that must be always kept at the bottom of the z-order.
2 - The transparent contact sheet (using a negative ID).
3 - All the sprites with a unique ID ranging from 1 to maxcount.
4 - The frame to be drawn to show the focus ID (with a negative ID)
5 - The left Arrow (with a negative ID)
6 - The right Arrow (with a negative ID)

Negative ID are used for the sprites that never changed, while positive ID is used for the dynamic one, each time a new set of data is added to the TMDB folder.

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #335 on: November 14, 2017, 02:11:14 pm »
I dont get any further
what can I use for Create32bitDC?

hmmm...

greets

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #336 on: November 14, 2017, 03:21:46 pm »
Code: [Select]
HBITMAP zCreateDIBSection (IN HDC hDC, IN long nWidth, IN long nHeight, IN long nBitCount) { // exportdll
    BITMAPINFO bi = { 0 };
    BYTE* lpBitmapBits = NULL;
    bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
    bi.bmiHeader.biWidth = nWidth;
    bi.bmiHeader.biHeight = nHeight;
    bi.bmiHeader.biPlanes = 1;
    bi.bmiHeader.biBitCount = (WORD) nBitCount;
    bi.bmiHeader.biCompression = BI_RGB;
    return CreateDIBSection(hDC, &bi, DIB_RGB_COLORS, (LPVOID*)&lpBitmapBits, NULL, 0);
}

HDC ZI_Create32bitDC (IN long nWidth, IN long nHeight, IN long ARGBcolor) { // dllexport
    HDC hIC = zDisplayDC();
    HDC hDC = CreateCompatibleDC(hIC);
    HBITMAP hDIB = zCreateDIBSection(hDC, nWidth, nHeight, 32);
    SelectObject(hDC, hDIB);
    DeleteDC(hIC);
    BYTE A, R, G, B;
    zSplitColorARGB(ARGBcolor, A, R, G, B);
    BITMAP bm;
    GetObject(hDIB, sizeof(bm), &bm);
    BYTE* pBits = (BYTE*) bm.bmBits;
    for (long K = 0; K < (nWidth * nHeight); ++K) {
        pBits[3] = A;
        pBits[2] = R;
        pBits[1] = G;
        pBits[0] = B;
        pBits += 4;
    }
    return hDC;
}

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #337 on: November 14, 2017, 03:38:06 pm »
thank you very much :)

greets
« Last Edit: November 15, 2017, 05:08:39 pm by Emil Weiss »

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #338 on: November 15, 2017, 05:58:38 pm »
i understand now what your do in MoveIconUpDown..
thanks again for Show the source code to.

question again why your set a negative value for "ID_RECT = -104;"

so the x,y pos start on beginning with 0 ?

which value your stored with ZD_SetObjectLocked(ID_RECT, TRUE); ?

greets
« Last Edit: November 15, 2017, 06:14:01 pm by Emil Weiss »

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #339 on: November 15, 2017, 08:29:04 pm »
Quote
which value your stored with ZD_SetObjectLocked(ID_RECT, TRUE); ?
In GDImage the user can move an object around with the mouse or the arrow keys as soon as an object got the focus, except if the object is locked, that is the same than using EnableWindow(hWnd, FALSE).

Yes the first time X,Y starts at 0.

In GDImage each object has a unique ID in the range of long, in TMD 1 to MaxCount is reserved for the poster icon to match the hidden ListBox with the movie names. See gTMD.hListPoster.

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #340 on: November 17, 2017, 12:45:00 am »
it's ok i am not use tooltips any more is not posible by me with sprite.
so you can clean up the last messages ;)

Thank you..

greets

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #341 on: November 17, 2017, 02:48:29 pm »
Patrice,

i have fix it on the old way :)
and is any faster then a real tooltip.

greets

Patrice Terrier

  • Administrator
  • *****
  • Posts: 539
    • zapsolution
Re: KVideoPlayer API (madVR interface)
« Reply #342 on: November 17, 2017, 07:37:56 pm »
Good, i would suggest however to use an opaque background behind the text to make it more readable. (like for a tooltip)

Emil Weiss

  • Sr. Member
  • ****
  • Posts: 313
Re: KVideoPlayer API (madVR interface)
« Reply #343 on: November 17, 2017, 07:53:31 pm »
Good, i would suggest however to use an opaque background behind the text to make it more readable. (like for a tooltip)

i want test it :)

greets