In my project we are using adobe flash builder 4.6 as a client-side scripting,visual studio as a mediator(for connecting the oracle database).In this, in flex 4.6 we are capturing images from webcam that's working fine, after capturing the image we need to save this captured image in oracle database so in order to save we need to pass this image from flex to dot-net(visual studio) so i need a help on how to approach to done this(passing the image from flex to dot-net) if any one knows please help me i will be very thankful to them
Asked
Active
Viewed 180 times
0
-
Finally i got the solution from this link,it works for me http://stackoverflow.com/questions/5702239/how-to-pass-image-from-a-flex-application-to-a-asp-net-c-sharp-web-service – Srikanth Sri Sep 26 '13 at 06:32
1 Answers
0
Finally i got the solution,what i did is
<mx:HTTPService id="savepcktdata" method="POST"
url="{URL}com/...../..../PckInbox.aspx"
result="savepcktdata_resultHandler(event)"
resultFormat="text">
<mx:request>
<Operation>savepcktdata</Operation>
<bytes>
{str64enc}
</bytes>
</mx:request>
</mx:HTTPService>
You must pass the base64string as above through Httpservice from flex to dotnet
We will get the image as bytes after taking a pic from webcam and after getting bytes u need to
make some conversions to those image bytes as follows and then u need to pass to a base64 string
below method describes how to do conversions;
[Bindable]public var imgbytes:ByteArray=new ByteArray();
[Bindable]public var str64enc:String="";
protected function btnimage_clickHandler(event:MouseEvent):void
{
// TODO Auto-generated method stub
if(webimage1.content==null)
{
takepicture1();
}
else if(webimage2.content==null)
{
takepicture2();
}
}
Here webimage1 is the id of image tag like...
<mx:Image id="webimage1" height="18" width="20"/>
public function takepicture1():void
`{
var urlRequest:URLRequest = new URLRequest();
var picture1:BitmapData=new BitmapData(vddisplay.height,vddisplay.width);
picture1.draw(vddisplay);
webimage1.source=new Bitmap(picture1);
var je1:JPEGEncoder=new JPEGEncoder(50);
imgbytes=je1.encode(picture1);
var base64enc:Base64Encoder=new Base64Encoder();
base64enc.encodeBytes(imgbytes);
str64enc=base64enc.toString();
}
`
In Dotnet;
string str = Convert.ToString(Request.Form["bytes"]);

Srikanth Sri
- 31
- 10