Screen Capturing in JPG format and not Bitmap
-
I want to make a screen capturing application which captures and stores in JPG or GIF format and not in Bitmap format. I have examples from codeproject but all of them are using Bitmap b'coz of which when i save themin a bitmap file for sending to the server the file size if too much. Thanks & Regards. Dhiraj Kumar Saini
-
I want to make a screen capturing application which captures and stores in JPG or GIF format and not in Bitmap format. I have examples from codeproject but all of them are using Bitmap b'coz of which when i save themin a bitmap file for sending to the server the file size if too much. Thanks & Regards. Dhiraj Kumar Saini
You can convert the bitmap to a JPG and then...
It is a crappy thing, but it's life -^ Carlo Pallini
-
You can convert the bitmap to a JPG and then...
It is a crappy thing, but it's life -^ Carlo Pallini
If you can provide some code or example as to how ro convert it would of great help.
-
I want to make a screen capturing application which captures and stores in JPG or GIF format and not in Bitmap format. I have examples from codeproject but all of them are using Bitmap b'coz of which when i save themin a bitmap file for sending to the server the file size if too much. Thanks & Regards. Dhiraj Kumar Saini
Use GDI+ to save to JPG. Once you have a HBITMAP containing the screenshot do Something like this (can't remember the correct objects/methods now so you will have to look them up, but it generally goes something like this):
Gdiplus::Bitmap Img; //or maybe Gdiplus::Image...
Img.Attach(hbitmap_screenshot); //or fromHBITMAP()...
Img.Save(path_to_save_to, Gdiplus::ImageFormatJPEG);
Img.Detach();> The problem with computers is that they do what you tell them to do and not what you want them to do. <
-
If you can provide some code or example as to how ro convert it would of great help.
If you are using MFC, you could use
CImage::Save()
withImageFormatJPEG
orImageFormatGIF
as theguidFileType
field. -
If you are using MFC, you could use
CImage::Save()
withImageFormatJPEG
orImageFormatGIF
as theguidFileType
field.Rajesh R Subramanian wrote:
If you are using MFC
Hey man, you're using your superpowers. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Use GDI+ to save to JPG. Once you have a HBITMAP containing the screenshot do Something like this (can't remember the correct objects/methods now so you will have to look them up, but it generally goes something like this):
Gdiplus::Bitmap Img; //or maybe Gdiplus::Image...
Img.Attach(hbitmap_screenshot); //or fromHBITMAP()...
Img.Save(path_to_save_to, Gdiplus::ImageFormatJPEG);
Img.Detach();> The problem with computers is that they do what you tell them to do and not what you want them to do. <
Thanks Its Working :)
-
If you are using MFC, you could use
CImage::Save()
withImageFormatJPEG
orImageFormatGIF
as theguidFileType
field.Thanks its working!
-
Rajesh R Subramanian wrote:
If you are using MFC
Hey man, you're using your superpowers. :-D
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Well, my CPMRU is fully charged. :-D
It is a crappy thing, but it's life -^ Carlo Pallini
-
I want to make a screen capturing application which captures and stores in JPG or GIF format and not in Bitmap format. I have examples from codeproject but all of them are using Bitmap b'coz of which when i save themin a bitmap file for sending to the server the file size if too much. Thanks & Regards. Dhiraj Kumar Saini
-
If you are using MFC, you could use
CImage::Save()
withImageFormatJPEG
orImageFormatGIF
as theguidFileType
field.I am able to save it in JPG format but the size of the file is somewhere around 150KB. Is there any way I can Optimize the size to somewhere below 100KB as it needs to be sent to the server for real time monitoring. Thanks In Advance