screenshot from this site

priestxandar

Client
Joined
Aug 28, 2012
Messages
35
Reaction score
1
Points
8

Hungry Bulldozer

Moderator
Joined
Jan 12, 2011
Messages
3,441
Reaction score
837
Points
113
Hi,

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

priestxandar

Client
Joined
Aug 28, 2012
Messages
35
Reaction score
1
Points
8

bigcajones

Client
Joined
Feb 9, 2011
Messages
1,216
Reaction score
684
Points
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
Joined
Jan 12, 2011
Messages
3,441
Reaction score
837
Points
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");
}
 
  • Thank you
Reactions: bigcajones

Hungry Bulldozer

Moderator
Joined
Jan 12, 2011
Messages
3,441
Reaction score
837
Points
113
Btw it does work pretty fine even with step = 20000;
 

hsupowers

Client
Joined
Dec 26, 2012
Messages
40
Reaction score
3
Points
8
the code is wrong...:(
A generic error occurred in GDI+.
 

rostonix

Известная личность
Joined
Dec 23, 2011
Messages
29,067
Reaction score
5,719
Points
113
What build do you use?
 

archel

Client
Joined
May 2, 2011
Messages
175
Reaction score
22
Points
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

Известная личность
Joined
Dec 23, 2011
Messages
29,067
Reaction score
5,719
Points
113
This code works fine. What build do you use?
 

archel

Client
Joined
May 2, 2011
Messages
175
Reaction score
22
Points
18
I use 4.5.0.2.
Same error as the person above: "A generic error occurred in GDI"

Here's the basic template:
View attachment take-screenshot.xmlz

Would be nice if you could take a look at it.
 

rostonix

Известная личность
Joined
Dec 23, 2011
Messages
29,067
Reaction score
5,719
Points
113
Do you have folder C:\images\ which is used in this code?
 
  • Thank you
Reactions: archel

archel

Client
Joined
May 2, 2011
Messages
175
Reaction score
22
Points
18
Nice. I did not. Thought it would automatically create it.
It solved the problem. Thanks!
 

Vice

Client
Joined
Sep 11, 2012
Messages
3
Reaction score
0
Points
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
Code:
var path = project.Variables["theme"].Value;
to set variable, but do not know how to use it to set filename in
Code:
img.Save(@"C:\images\part"+count.ToString()+@".jpg");
 

Hungry Bulldozer

Moderator
Joined
Jan 12, 2011
Messages
3,441
Reaction score
837
Points
113
img.Save(@"C:\images\screen-"+path+@".jpg");
 

cool7878

Client
Joined
Feb 22, 2013
Messages
28
Reaction score
1
Points
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

Известная личность
Joined
Dec 23, 2011
Messages
29,067
Reaction score
5,719
Points
113
New build has option for your task: Image processing action
 
  • Thank you
Reactions: irmscher

cool7878

Client
Joined
Feb 22, 2013
Messages
28
Reaction score
1
Points
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

Известная личность
Joined
Dec 23, 2011
Messages
29,067
Reaction score
5,719
Points
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!)
 

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)