kevindelaney
asked on
Capture screenshot as JPEG and store in memory
Hi there!
I'm looking to take a screenshot of the active window as a JPEG, and store it in memory so that I can later send it via an HTTP POST operation. I need to be able to manually adjust the quality so I can control the file size. I tried to do some reading on the jpeg library, but coming from a .NET background, I couldn't really figure it out. Is the one that comes with Delphi the best one to use for this situation?
Thanks for any and all assistance!
I'm looking to take a screenshot of the active window as a JPEG, and store it in memory so that I can later send it via an HTTP POST operation. I need to be able to manually adjust the quality so I can control the file size. I tried to do some reading on the jpeg library, but coming from a .NET background, I couldn't really figure it out. Is the one that comes with Delphi the best one to use for this situation?
Thanks for any and all assistance!
how to send via http post a image file ?
ASKER
wd123: Thanks for the links and help. Would you be able to quickly post how I can resize the JPEG by 50%? For example if it's 1024x768 I want to reduce it to 800x600 before storing it in the memory. I've looked everywhere and can't seem to get it to work with this code. The closest thing I found was this:
https://www.experts-exchange.com/questions/21569254/How-to-resize-a-bmp-or-jpg-image.html
Which I wasn't able to get successfully working.
I will award points if you can solve this for me! (increased to 200)
Thanks again!
https://www.experts-exchange.com/questions/21569254/How-to-resize-a-bmp-or-jpg-image.html
Which I wasn't able to get successfully working.
I will award points if you can solve this for me! (increased to 200)
Thanks again!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what part of this PAQ did you have problems with?
http://delphi.about.com/od/graphics/a/resize_image.htm
http://delphi.about.com/od/graphics/a/resize_image.htm
ASKER
Great solution and fast. Worked perfectly. THANK YOU!
var
Image: TJPEGImage;
begin
Image := TJPEGImage.Create;
try
if GetScreenShot(GetDesktopWi
finally
Image.Free;
end;
Open in new window