using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace CCapture
{
class Program : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
static void Main(string[] args)
{
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpScreenshot.Save("C:\\ThaiCreate\\Capture.jpg", ImageFormat.Jpeg);
gfxScreenshot.Dispose();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace CCapture
{
class Program : Form
{
[STAThread]
static void Main(string[] args)
{
System.Threading.Thread t = new System.Threading.Thread(ThreadStart);
t.SetApartmentState(System.Threading.ApartmentState.STA);
t.Start();
}
private static void ThreadStart()
{
WebBrowser web = new WebBrowser();
web.ScrollBarsEnabled = false;
web.ScriptErrorsSuppressed = true;
web.Navigate("https://www.thaicreate.com");
while (web.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete)
System.Windows.Forms.Application.DoEvents();
System.Threading.Thread.Sleep(1500);
int width = web.Document.Body.ScrollRectangle.Width;
int height = web.Document.Body.ScrollRectangle.Height;
web.Width = width;
web.Height = height;
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height);
web.DrawToBitmap(bmp, new System.Drawing.Rectangle(0, 0, width, height));
bmp.Save("C:\\tc\\thaicreate.jpg", ImageFormat.Jpeg);
bmp.Dispose();
}
}
}
Imports System
Imports System.Data
Imports System.Windows.Forms
Imports System.Drawing.Imaging
Imports System.IO
Imports System.Data.SqlServerCe
Module Module1
'By https://www.thaicreate.com (mr.win) '
<STAThread()> _
Sub Main(ByVal args As String())
Dim t As New System.Threading.Thread(AddressOf ThreadStart)
t.SetApartmentState(System.Threading.ApartmentState.STA)
t.Start()
End Sub
Private Sub ThreadStart()
'*** Capture Web Page ***//
Dim web As New WebBrowser()
web.ScrollBarsEnabled = False
web.ScriptErrorsSuppressed = True
Dim strURL As String = "https://www.thaicreate.com"
Dim fileName As String = DateTime.Now.ToString("ddMMyyyyHHmmss") & ".jpg"
web.Navigate(strURL)
While web.ReadyState <> System.Windows.Forms.WebBrowserReadyState.Complete
System.Windows.Forms.Application.DoEvents()
End While
System.Threading.Thread.Sleep(1500)
Dim width As Integer = web.Document.Body.ScrollRectangle.Width
Dim height As Integer = web.Document.Body.ScrollRectangle.Height
web.Width = width
web.Height = height
Dim bmp As New System.Drawing.Bitmap(width, height)
web.DrawToBitmap(bmp, New System.Drawing.Rectangle(0, 0, width, height))
bmp.Save(Directory.GetCurrentDirectory() & "\Img\" & fileName, ImageFormat.Jpeg)
bmp.Dispose()
End Sub
End Module
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Drawing.Imaging;
using System.IO;
namespace CCapture
{
class Program : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
static void Main(string[] args)
{
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
bmpScreenshot.Save("C:\\ThaiCreate\\Capture.jpg", ImageFormat.Jpeg);
gfxScreenshot.Dispose();
}
}
}