public static extern int SetDIBitsToDevice(HDC hdc, int x, int y, int dx, int dy, int SrcX, int SrcY, int Scan, int NumScans, IntPtr Bits, BITMAPINFO BitsInfo, int wUsage);
public static extern int StretchDIBits(HDC hdc, int x, int y, int dx, int dy, int SrcX, int SrcY, int wSrcWidth, int wSrcHeight, IntPtr lpBits, ref BITMAPINFO lpBitsInfo, int wUsage, int dwRop);
public static extern int SetDIBits(HDC hdc, HANDLE hBitmap, int nStartScan, int nNumScans, IntPtr lpBits, ref BITMAPINFO lpBI, int wUsage);
public static extern int CreateDIBSection(HWND hdc, ref BITMAPINFO pBitmapInfo, int un, ref IntPtr lplpVoid, HANDLE handle, int dw);
public static extern int CreateDIBitmap(HDC hdc, ref BITMAPINFOHEADER lpInfoHeader, int dwUsage, IntPtr lpInitBits, ref BITMAPINFO lpInitInfo, int wUsage);
public void TempRecieve(byte[] buffer,ref BITMAPINFO _info, DataType bDataType, int X, int Y,int width,int height,int size) { }
public Image RecieveDataEx(byte[] buffer, ref BITMAPINFO _info, DataType bDataType, int X, int Y,int width,int height,int size) { try { if(!bIsServer) { if(buffer != null) { buffer = UncompressBufferEx(ref buffer,size); } //for client side this will reutrn the image if(bDataType == DataType.SizeInformation) { // if(bClientBitmap != null) // bClientBitmap.Dispose(); // if(X<=0 || Y<=0) // return null; // bClientBitmap = new System.Drawing.Bitmap(X,Y); // bitmapGraphics=Graphics.FromImage(bClientBitmap); // bitmapGraphics.Clear(System.Drawing.Color.White); } else { // if(bitmapGraphics != null) // { Image image = AppSharing.ByteArrayToImage(buffer);//UncompressAndGetImage(buffer); try { if(image==null) { //Trace.WriteLine("Image is null...Exception will occur"); if(isWaitingPic) { //Console.WriteLine("isWaitingPic = true"); isWaitingPic = false; //Trace.WriteLine("isWaitingPic = false"); image=Image.FromFile(Application.StartupPath + @"\AppDefault.JPG"); //bitmapGraphics.DrawImage(img,X,Y); //img.Dispose(); } else return null; } else return image; //bitmapGraphics.DrawImage(image,X,Y); //image.Dispose(); } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: AppShare public Image RecieveDataEx(byte[] buffer, ref BITMAPINFO _info, DataType bDataType, int X, int Y,int width,int height,int size)",ex,"",false); // if(isWaitingPic) // { // //Console.WriteLine("isWaitingPic = true"); // isWaitingPic = false; // //Trace.WriteLine("isWaitingPic = false"); // Image img = Image.FromFile(Application.StartupPath + @"\AppDefault.JPG"); // bitmapGraphics.DrawImage(img,X,Y); // img.Dispose(); // } // else // return null; //GC5 } GC.Collect(); //KH GC.WaitForPendingFinalizers(); //KH // counter++; // bClientBitmap.Save("c:\\temp\\"+counter.ToString()+".bmp"); return image; // } } } } catch(Exception ex) { WebMeeting.Client.ClientUI.getInstance().ShowExceptionMessage("Module ::: AppShare public Image RecieveDataEx(byte[] buffer, ref BITMAPINFO _info, DataType bDataType, int X, int Y,int width,int height,int size)",ex,"",false); } return null; }