screenshot from this site

priestxandar

Client
Регистрация
28.08.2012
Сообщения
35
Благодарностей
1
Баллы
8

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
Hi,

It is too big. The only way to that is with c# code.
 

priestxandar

Client
Регистрация
28.08.2012
Сообщения
35
Благодарностей
1
Баллы
8

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(screenWidth, screenHeight);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(screenWidth, screenHeight));
bmpScreenShot.Save(@"C:\test4.jpg");

Then you will have to do keystroke emulation to scroll down to capture rest. And your instance will have to be maximized because this takes a screenshot of the full screen.
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
JavaScript:
HtmlElement he = instance.ActiveTab.FindElementByAttribute("body","fulltag","body","text",0);
int heHeight = Convert.ToInt32(he.GetAttribute("height"));
int heWidth = Convert.ToInt32(he.GetAttribute("width"));
int step =1000;
int countOfIterations = heHeight/step;
var bitmaps = new List<System.Drawing.Bitmap>();
int count =0;
for(int i =0;i<countOfIterations;i++)
{
	var text = he.DrawPartToBitmap(0, i*step, heWidth, step, true);
	byte[] imageBytes = Convert.FromBase64String(text);
	var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
	var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
	img.Save(@"C:\images\part"+i.ToString()+@".jpg");
	count++;
}
int lastPieceHeight = heHeight%step;
if (lastPieceHeight>10)
{
	var text = he.DrawPartToBitmap(0, heHeight-lastPieceHeight, heWidth, lastPieceHeight, true);
	byte[] imageBytes = Convert.FromBase64String(text);
	var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
	var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
	img.Save(@"C:\images\part"+count.ToString()+@".jpg");
}
 
  • Спасибо
Реакции: bigcajones

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
Btw it does work pretty fine even with step = 20000;
 

hsupowers

Client
Регистрация
26.12.2012
Сообщения
40
Благодарностей
3
Баллы
8
the code is wrong...:(
A generic error occurred in GDI+.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
What build do you use?
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
JavaScript:
HtmlElement he = instance.ActiveTab.FindElementByAttribute("body","fulltag","body","text",0);
int heHeight = Convert.ToInt32(he.GetAttribute("height"));
int heWidth = Convert.ToInt32(he.GetAttribute("width"));
int step =1000;
int countOfIterations = heHeight/step;
var bitmaps = new List<System.Drawing.Bitmap>();
int count =0;
for(int i =0;i<countOfIterations;i++)
{
	var text = he.DrawPartToBitmap(0, i*step, heWidth, step, true);
	byte[] imageBytes = Convert.FromBase64String(text);
	var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
	var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
	img.Save(@"C:\images\part"+i.ToString()+@".jpg");
	count++;
}
int lastPieceHeight = heHeight%step;
if (lastPieceHeight>10)
{
	var text = he.DrawPartToBitmap(0, heHeight-lastPieceHeight, heWidth, lastPieceHeight, true);
	byte[] imageBytes = Convert.FromBase64String(text);
	var ms = new System.IO.MemoryStream(imageBytes, 0, imageBytes.Length);
	var img = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
	img.Save(@"C:\images\part"+count.ToString()+@".jpg");
}
I foolishly hoped that I would just have to add this code to own c# code block in projectmaker after first going to a webpage...to take a screenshot. It seems it doesn't work. Can anyone tell what should be done more or is it too hard for somebody who doesn't know a lot about c#?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
This code works fine. What build do you use?
 

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Do you have folder C:\images\ which is used in this code?
 
  • Спасибо
Реакции: archel

archel

Client
Регистрация
02.05.2011
Сообщения
175
Благодарностей
22
Баллы
18
Nice. I did not. Thought it would automatically create it.
It solved the problem. Thanks!
 

Vice

Client
Регистрация
11.09.2012
Сообщения
3
Благодарностей
0
Баллы
0
Could anybody help me with this code?

I need to save screenshots with filenames like screen-aaaaa.jpg where aaaaa is value of my variable called "theme"
I use
Код:
var path = project.Variables["theme"].Value;
to set variable, but do not know how to use it to set filename in
Код:
img.Save(@"C:\images\part"+count.ToString()+@".jpg");
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
img.Save(@"C:\images\screen-"+path+@".jpg");
 

cool7878

Client
Регистрация
22.02.2013
Сообщения
28
Благодарностей
1
Баллы
3
Hi
The code was working fine until I upgraded Zenno to the latest version. looks like some changes is needed but I could not figure it out . Now if I run this it gives OwnCode Parameter is invalid. Try to capture any image using this and it will not work in the version 5.9.3.1. It is still working fine with older version. Please help. Thanks Raj
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
New build has option for your task: Image processing action
 
  • Спасибо
Реакции: irmscher

cool7878

Client
Регистрация
22.02.2013
Сообщения
28
Благодарностей
1
Баллы
3
aha! I did not see that. Works like a charm :-) Man your tools is a life changer for me. Whatever money I started making online is because of your tool only. Its a beautiful piece of software. If you need any testimony let me know. I can write up something for your tool :-) Thanks Raj
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
aha! I did not see that. Works like a charm :-) Man your tools is a life changer for me. Whatever money I started making online is because of your tool only. Its a beautiful piece of software. If you need any testimony let me know. I can write up something for your tool :-) Thanks Raj
That's great that sofwtare makes your life easier :-)
That's our goal!)
 

Кто просматривает тему: (Всего: 3, Пользователи: 0, Гости: 3)