How to obtain a alphablend image in wince 6.0 for a particular child window for n number of times? for example if i have a vol bar graph window which is for volume increase & decrease which is changed on click of vol+ or Vol- button so if i want to keep vol bar graph window as an alphablend image in wince 6.0 then how shall i obtain? Because i have tried in win32 application and i was able to do but i was not able to perform the same in wince 6.0 ?
I have used the below function for painting image for volBarGraph in wince 6.0
void AdjustAlphablendImage(int imgId, char axis_id)
{
LogEntry(L"Entered in AdjustAlphablendImage Function");
BLENDFUNCTION bf;
bf.BlendOp=AC_SRC_OVER;
bf.BlendFlags=0;
bf.SourceConstantAlpha=55;
bf.AlphaFormat=0;
HBITMAP bmp = LoadBitmap(handles.hInstance,
MAKEINTRESOURCE(imgId));
HDC wdc = GetWindowDC(handles.parent);
HDC tdc = CreateCompatibleDC(wdc);
SelectObject(tdc,bmp);
AlphaBlend(wdc ,
imgs[axis_id].x,
imgs[axis_id].y,
imgs[axis_id].width ,
imgs[axis_id].height,
tdc ,0 ,0 ,
imgs[axis_id].widthSrc,
imgs[axis_id].heightSrc,
bf);
DeleteDC(wdc);
DeleteDC(tdc);
DeleteObject(bmp);
ReleaseDC(handles.parent,wdc);
LogEntry(L"Exited from AdjustAlphablendImage Function");
}
here 'handles' is an object of type 'HANDLES' and 'parent' is a data member of 'HANDLES' of type 'HWND'.
My structure 'HANDLES' is mentioned below
struct HANDLES
{
HINSTANCE hInstance;
HWND parent;
HWND volUp;
HWND volDown;
HWND volOnOff;
HWND chUp;
HWND chDown;
HWND tvOnOff;
HWND tvTitle;
HWND volBarGraph; // I am doing alphablending on this...................
HWND chNo;
HWND chNoBcg;
HWND audioStatus;
HWND subTitleStatus;
HWND message;
HWND prevHandle;
WNDPROC oldButtonWndProc;
HWND pressedButton;
int prevButtonId;
char prevButtonAxis;
char screenMode;
};
//The below function is used for calling AdjustAlphablendImage function for volBarGraph.
AdjustAlphablendImage(
volumeStatus.volume + volumeStatus.status + INITIAL_VOLUME, // This is used for taking proper image on particular click of vol+ or vol- Button.
AXIS_VOL_BAR_GRAPH
);
Also how to erase background image in wince 6.0?
Please Reply
Thanks