Save Bitmap from Flash to .NET as JPG



Hi everyone,

Just joined this community. I have a question about saving bitmap
images from flash too a .NET site using VBScript.

There are several tutorials showing how this can be done using php--for
instance, check out

http://www.flash-db.com/Tutorials/snapshot/index.php

http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php

But there is not enough help and support for those who have to use
VBScript.

Basically, I need to write a script that does exactly the same thing as
the php scripts given in the tutorials above, and I have no clue how I
will do that. VBS is sooo different than php, and I'm not used to it at
all. Besides, without the intrinsic GD library of php, it looks like I
might need to install an external GD library to work with.

This is the php code I'm talking about.

//If GD library is not installed, say sorry
if(!function_exists("imagecreate")) die("Sorry, you need GD library
to run this example");
//Capture Post data
$data = explode(",", $_POST['img']);
$width = $_POST['width'];
$height = $_POST['height'];
//Allocate image

$image=(function_exists("imagecreatetruecolor"))?imagecreatetruecolor(
$width ,$height ):imagecreate( $width ,$height);
imagefill($image, 0, 0, 0xFFFFFF);
//Copy pixels
$i = 0;
for($x=0; $x<=$width; $x++){
for($y=0; $y<=$height; $y++){
while(strlen($data[$i]) < 6) $data[$i] = "0" . $data[$i];
$r = 255-hexdec("0X".substr( $data[$i] , 0 , 2 ));
$g = 255-hexdec("0x".substr( $data[$i] , 2 , 2 ));
$b = 255-hexdec("0x".substr( $data[$i++] , 4 , 2 ));
$color = ($r << 16) | ($g << 8) | $b;
$color = imagecolorallocate($image, $r, $g, $b);
imagesetpixel ( $image , $x , $y , $color );
}
}
//Output image and clean
header( "Content-type: image/jpeg" );
ImageJPEG( $image );
imagedestroy( $image );
}


Hoping that someone has had to do something like this at one point or
another. All advice would be appreciated.

.



Relevant Pages

  • Save Bitmap from Flash to .NET as JPG
    ... from flash too a .NET site using VBScript. ... There are several tutorials showing how this can be done using php (for ... might need to install an external GD library to work with. ...
    (microsoft.public.dotnet.languages.vb)
  • Dynamic event binding to IE (not the DOM!)
    ... VBScript, InternetExplorer.Application is brought up and VBScript ... procedures within the .vbs are dynamically bound to events in its DOM. ... I am writing a PHP server side app. ... However, if the PHP script is invoked as a web server script, ...
    (microsoft.public.scripting.vbscript)
  • Re: PHP vs. ASP
    ... I'm going to assume you mean VBScript, since that's the most common ASP ... I have worked extensively in both PHP and VBScript. ... quite frequently studded with comments ranting about the language. ...
    (comp.lang.php)
  • Re: PHP vs. ASP
    ... Malbolge is light years beyond VBScript. ... > ASP. ... > programming languages existing today. ... protocol, not a language, so when people say something like "ASP vs PHP" ...
    (comp.lang.php)
  • Re: Frontpage web design using standard scripting lang (read no ASP nor VBScript)
    ... ASP and VBScript has been around ... Its just I have a requirement to build identical dynamic web ... > before PHP. ...
    (microsoft.public.frontpage.client)