Hi

I've made a little application that connect to a camera server that send throught sockets JFIF images composed of a vertical line of squares of 16x16px. In the header of the socket i can retreive the number of squares in the image and the position of each. The thing is that the drawing is kind of slow (about one seconds for 16 squares) I'd like to know if there is a method that draw jpeg faster. here's mine
Code:
for (int i =0; i < nbofframes; i++) {
				try {
					CWaitCursor wc;

					int xScale = 16; //(320/20)
					int yScale = 16; // (240/15)

					int x = bytesReceived[0x64+(i*2)];
				int y = bytesReceived[0x64+(i*2)+1];
					

						dataStream = new System::IO::MemoryStream(jpegData);

						image = Image::FromStream(dataStream);
						//image->Save(S"c:\\jpg\\jpg" + jpgFile + S".jpg");

						graphics = Graphics::FromHdc(dcCam1.GetSafeHdc());

						RECT clientRect;
						_this->m_cam1.GetClientRect(&clientRect);
						clientRect.top = yScale * y;
						clientRect.left = xScale * x;
						clientRect.right = 16+clientRect.left;
						clientRect.bottom = 16+clientRect.top;
						Drawing::Rectangle clRect(clientRect.left, clientRect.top, 16, 16);
						Drawing::Rectangle imageRect(0, i*16, 16, 16);
						graphics->FillRectangle(SystemBrushes::Control, clientRect.left, clientRect.top, clientRect.right-clientRect.left, clientRect.bottom - clientRect.top);
						//graphics->DrawImage(image,0,0, image->Width, image->Height);
						graphics->DrawImage(image,clRect, imageRect, GraphicsUnit::Pixel);
				}
				catch(Exception* e) {
					AfxMessageBox((CString)e->Message);
				}
				__finally {
					if (graphics) graphics->Dispose();
					if (image) image->Dispose();
					if (dataStream) dataStream->Dispose();
				}
			}
Thanks

Shootrz