2010-03-25 4 views

Répondre

1

une certaine stratégie, je vais essayer de mettre en oeuvre:

  1. texte d'étirage avec GDI en bitmap de taille d'image (VideoHandle-> piSuites-> ppixFuncs-> ppixGetBounds)
  2. pixels de cadre de recouvrement (VideoHandle-> Source) avec des pixels de bitmap

UPDATE alt text http://img413.imageshack.us/img413/6201/adobe.jpg échantillon de travail, en utilisant l'échantillon de Simple_Video_Filter SDK ...

au début de xFilter fonction (sélecteur court, VideoHandle theData) créer bitmap avec le texte:

TCHAR szBuffer[50] = {0}; 
RECT rect; 
HDC hdc = GetDC(NULL); 
int iLength = 0; 
iLength = wsprintf(szBuffer, "Hello World!"); 
BITMAPINFO bmInfo; 
memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER)); 
bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); 
bmInfo.bmiHeader.biWidth=100; 
bmInfo.bmiHeader.biHeight=15; 
bmInfo.bmiHeader.biPlanes=1; 
bmInfo.bmiHeader.biBitCount = 32; 
bmInfo.bmiHeader.biCompression = BI_RGB; 
//create a temporary dc in memory. 
HDC pDC = GetDC(0); 
HDC TmpDC=CreateCompatibleDC(pDC); 
//create a new bitmap and select it in the memory dc 
BYTE *pbase; 
HBITMAP TmpBmp=CreateDIBSection(pDC, &bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0); 
HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp); 
SetRect(&rect, 0, 0, 100, 15); 
DrawText(TmpDC, szBuffer, iLength, &rect, 32); 

dans le milieu où le filtre est réglé, au lieu de

redSource = (redSource + redAdd) & 0x000000ff; 
greenSource = (greenSource + greenAdd) & 0x000000ff; 
blueSource = (blueSource + blueAdd) & 0x000000ff; 

utilisation

int x = vert; 
int y = horiz; 
if(x < 215 && y < 300) 
{ 
    COLORREF c = GetPixel(TmpDC,y-200, 215 - x); 
    if(0 == ((int)GetRValue(c)+(int)GetGValue(c)+(int)GetBValue(c))) 
    { 
     redSource =255; 
     greenSource =255; 
     blueSource =255; 
    } 
} 

et à la fin de la fonction de nettoyage de la mémoire

SelectObject(TmpDC,TmpObj); 
DeleteDC(TmpDC); 

PS [un jour :)] besoin de stocker bitmap dans la mémoire une fois au lieu de créer à chaque fois par image ...

+1

такое впечатления что такие "задачи" только и аутсорсить) т. е. где нету онлайн документации/кучи примеров/не продуманная архитектура) пс делал тоже плагин для премер про)) с апворка брал заказ) – Fortran