Hello, I'm trying to make a screenshot of an area of my application (map) and leave it in a directory on the server, it works correctly in my local environment (localhost), but when I go to the actual server ... as I can make it work there? show the code.
Greetings and thanks in advance
mmurgas
procedure capturar_area_pantalla_a_bitmap_temporal(ABitmap: TBitmap);
var
vDesktopDC: HDC; //contendrá el device context handle del escritorio actual
begin
vDesktopDC := GetWindowDC(GetDesktopWindow);
try
ABitmap.PixelFormat := pf24bit;
ABitmap.Height := Screen.Height;
ABitmap.Width := Screen.Width;
BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, vDesktopDC, 0, 0, SRCCOPY);
finally
ReleaseDC(GetDesktopWindow, vDesktopDC);
end;
end;
procedure capturar_pantalla_a_disco_formato_JPG(const fichero:string);
var
vJpg: TJpegImage;
vBmp: TBitmap;
begin
vBmp := TBitmap.Create;
try
capturar_area_pantalla_a_bitmap_temporal(vBmp);
vJpg := TJpegImage.Create;
try
vJpg.Assign(vBmp);
vJpg.CompressionQuality := 85; //calidad JPG 85%
vJpg.SaveToFile(fichero); //save format JPG
finally
vJpg.Free;
end;
finally
vBmp.Free;
end;
end;