Search Results

Search found 77 results on 4 pages for 'smoothing'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Some Problems Can't Be Outsourced

    - by mikef
    More and more companies are becoming attracted to the idea of Infrastructure as a Service (or IaaS). It would seem that you can outsource the provisioning and management of your services, encompassing everything from Email, through to your servers, workstations and software, all the way down to your LAN and internet services. This type of outsourcing can be a very attractive option for companies who have tight budgets who are short of technical skills or don't have the means to provide long-term IT support. Essentially, they can outsource your services at low short-term costs that are knowable and controllable, are quickly and easily scalable, and generate a minimum of hassle for your internal staff. If you want to get a sophisticated IT infrastructure set up in a hurry without the usual high buy-in costs, or the task of finding and hiring the right specialists. It would seem the way to go, particularly when their salesmen are hypnotizing you with oleaginous phrases such as "we are closely aligned with our client organization's core business requirements, providing agile services". It sounds too good to be true, and so it is. Whereas the costs will have initially been calculated on the annual renewal fees and service fees for ongoing support, there are other charges too which aren't so obvious. It can end up costing far more than the conventional solution once you take into account the extra costs, the fees for customization and upgrades. The Total Cost of Ownership (TCO) only becomes apparent when it is too late to extract the company easily from the arrangement. After a few years, these annual fees can add up to more than the initial cost of implementing a traditional in-house system. Worse than that is that you can then lose your power to determine your priorities: When you become reliant on this company, with its own schedule of priorities, to implement every change, however simple, you have effectively lost control of your technical infrastructure. This will make senior management very nervous. There is definitely a requirement for this sort of service. If you urgently need an exceptionally high class of service or more expertise than you currently possess, then outsourcing is probably for you. You and your IT colleagues will always have something to do, be it user assistance, smoothing out integrations with an external provider, or working on something entirely new. Heck, if you outsource to IBM, the SysAdmins can go along for the ride and polish their expertise. What you need to figure out is how much your time is worth, because time is ultimately all that outsourcing will buy you and your organization. Now you just need to convince your nervous CEO. Cheers, Michael

    Read the article

  • Need a new mouse: clicky scroll wheel and additional thumb-operated scroll wheel

    - by cksubs
    I'm having some carpel tunnel syndrome or RSI issues, and I need to get a new mouse. I've tried a friend's Logitech MX Revolution and it's almost perfect. I LOVE the thumb-operated scroll wheel, and I think that that alone would solve many of my hand pain issues. The problem is that it uses their newfangled smooth/click scroll wheel. It can be either smooth or clicky, and is switched by pressing in the scroll wheel. I really question Logitech's user research on that one. I've been using middle-click to open new links and close tabs for years now in my browser, and I'm not willing to give that up for this cool technology. In fact I HATE smooth scroll wheels in general, and need a clicky one. The option would be ok, but not if it's activated via the middle-click button. In closing, I'm looking for these items in my mouse: Thumb-operated scroll wheel or 'joystick'-like apparatus. Clicky, as-stiff-as-possible scroll wheel on top Normal middle-click functionality. Comfortable, preferably ergonomic design. Anyone have any suggestions? Logitech, want to get rid of that smoothing-scrolling crap so I can buy your mouse?

    Read the article

  • ClearType setting ignored in Windows Virtual PC with Windows XP Pro

    - by Yadyn
    I have a VM set up through Windows Virtual PC for Windows XP Pro and I have been completely unable to get ClearType to work. I have turned it on in the Display - Appearance - Effects dialog but it seems like it completely ignores this. All text is still without any anti-aliasing. Even setting it to normal smoothing doesn't work. If I disable Integration Features, it seems to work, but then I lose a lot of nice features. What's weirder, is that the Windows XP Mode installed with Windows Virtual PC (this is separate from my XP Pro VM) works with both ClearType and Integration Features just fine. I turned it on the same way and it works like a charm, no problems. I'm running Windows 7 Professional 64-bit as the host OS and have the latest (to my knowledge) Windows Virtual PC installed. The only funny business I can think of is that I've enabled 24-bit color via the Group Policy setting inside each XP virtual machine (both Pro and the stripped down XP mode copy). This is a fairly well-known trick documented all over the web, but here's a typical post about it.

    Read the article

  • Dual Monitor support rdp 7 to win 7 on esxi

    - by rphilli5
    I am trying to RDP from a Windows 7 Professional dual monitor physical machine to a Windows 7 Professional VM hosted on esxi 4.0. I can get the spanning option to work to both monitors, but I have tried 3 different methods of connecting but have not been able to use true multiple monitors. At different times, I tried checking the "use all monitors" option, command line mstsc /multimon and added the line use multimon:i:1 to the .rdp file. None of these worked. Any ideas? The physical machine can connect to other Windows 7 physical machines with true multi monitor access. I also have the same issue when going from a 32bit RC1 machine to a Windows 7 Professional x64, but not when going in the reverse direction. Here's the .rdp: screen mode id:i:2 use multimon:i:1 desktopwidth:i:1440 desktopheight:i:900 session bpp:i:16 winposstr:s:0,1,341,118,1139,568 compression:i:1 keyboardhook:i:2 audiocapturemode:i:0 videoplaybackmode:i:1 connection type:i:1 displayconnectionbar:i:1 disable wallpaper:i:1 allow font smoothing:i:0 allow desktop composition:i:0 disable full window drag:i:1 disable menu anims:i:1 disable themes:i:1 disable cursor setting:i:0 bitmapcachepersistenable:i:1 full address:s:192.168.1.5 audiomode:i:0 redirectprinters:i:1 redirectcomports:i:0 redirectsmartcards:i:1 redirectclipboard:i:1 redirectposdevices:i:0 redirectdirectx:i:1 autoreconnection enabled:i:1 authentication level:i:2 prompt for credentials:i:0 negotiate security layer:i:1 remoteapplicationmode:i:0 alternate shell:s: shell working directory:s: gatewayhostname:s: gatewayusagemethod:i:4 gatewaycredentialssource:i:4 gatewayprofileusagemethod:i:0 promptcredentialonce:i:1 use redirection server name:i:0 drivestoredirect:s:

    Read the article

  • What is the name of the this DOS font? Where and how to add it? Why is there a 1 pixel gap?

    - by JBeurer
    So basically I somehow stepped into this webpage: www.braindamage.vg And the first thing that hit me hard was the lovely DOS fonts, so naturally I wanted to get them into my IDE badly. Opened the html source file and CSS file to find the font name: @font-face { font-family: 'Perfect DOS VGA 437'; src: url('http://www.braindamage.vg/wp-content/themes/braindamage/dosfont.eot'); } @font-face { font-family: 'Perfect DOS VGA 437'; src: url('http://www.braindamage.vg/wp-content/themes/braindamage/dosfont.svg#dos') format("svg"), url('http://www.braindamage.vg/wp-content/themes/braindamage/dosfont.ttf') format ('truetype'); } So I download the font, add it using Control Panel - Fonts. But once I start using it (notepad, MSVS 2008 & MSVS2010) I notice that it looks slightly off: It seems like there's 1 extra pixel between each character. How it should look: What is causing it and how to fix this? Is it the windows XP? (i have disabled font smoothing) Or is there something wrong with the font file?

    Read the article

  • [AS3] BitmapData cut-off

    - by Fristi
    Hello, I am writing a MovieClip rasterizer which rasterizes all the frames in the specified movieclip. Here's the code for rasterizing: for ( var i:int = start; i <= end; i++ ) { //goto the next frame clip.gotoAndStop( i ); //get the bounds bounds = clip.getBounds(clip); //create a new bitmapdata container bitmapData = new BitmapData( transformer.width == -1 ? bounds.width : transformer.width, transformer.height == -1 ? bounds.height : transformer.height, transformer.transparent, transformer.color ); //rotate the clip if (clip.rotation != 0) transformer.rotate( clip.rotation * (Math.PI / 180) ); //scale the clip if (clip.scaleX != 1 || clip.scaleY != 1) transformer.scale( clip.scaleX, clip.scaleY ); //translate the movieclip to its zero point if (transformer.matrix.tx == 0 && transformer.matrix.ty == 0) transformer.translateToZero( bounds ); //draw the bitmap data with the transformers bitmapData.draw( this._source, transformer.matrix, transformer.colorTransform, transformer.blendMode, transformer.clipRect, //new Rectangle(0, 0, bounds.width, bounds.height), transformer.smoothing ); //push the data on the array frames.push( bitmapData ); } Now the result is different - http://i42.tinypic.com/lfv52.jpg - (note the head and left shoe). Anyone knows what the problem is? I've seen people adding 'extra' pixels to their boundary box at the BitmapData constructor, but thats nasty imo.

    Read the article

  • Soft Paint Bucket Fill: Colour Equality

    - by Bart van Heukelom
    I'm making a small app where children can fill preset illustrations with colours. I've succesfully implemented an MS-paint style paint bucket using the flood fill argorithm. However, near the edges of image elements pixels are left unfilled, because the lines are anti-aliased. This is because the current condition on whether to fill is colourAtCurrentPixel == colourToReplace (the colours are RGB uints) I'd like to add a smoothing/treshold option like in Photoshop and other sophisticated tools, but what's the algorithm to determine the equality/distance between two colours? if (match(pixel(x,y), colourToReplace) setpixel(x,y,colourToReplaceWith) How to fill in match()? Here's my current full code: var b:BitmapData = settings.background; b.lock(); var from:uint = b.getPixel(x,y); var q:Array = []; var xx:int; var yy:int; var w:int = b.width; var h:int = b.height; q.push(y*w + x); while (q.length != 0) { var xy:int = q.shift(); xx = xy % w; yy = (xy - xx) / w; if (b.getPixel(xx,yy) == from) { b.setPixel(xx,yy,to); if (xx != 0) q.push(xy-1); if (xx != w-1) q.push(xy+1); if (yy != 0) q.push(xy-w); if (yy != h-1) q.push(xy+w); } } b.unlock(null);

    Read the article

  • Masking FLV video in AS3 with PNG alpha channel.

    - by James Roberts
    Hey there, I'm trying to mask an FLV with a PNG alpha channel. I'm using BitmapData (from a PNG) but it's not working. Is there anything I'm missing? Cut up code below: var musclesLoader:Loader = new Loader(); var musclesContainer:Sprite = new Sprite(); var musclesImage:Bitmap = new Bitmap(); var musclesBitmapData:BitmapData; var musclesVideo:Video = new Video(752, 451.2); var connection:NetConnection = new NetConnection(); var stream:NetStream; function loadMuscles():void { musclesLoader.load(new URLRequest('img/muscles.png')); musclesLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, musclesComplete); } function musclesComplete():void { musclesBitmapData = new BitmapData(musclesLoader.content.width, musclesLoader.content.height, true, 0x000000); musclesImage.bitmapData = musclesBitmapData; musclesImage.smoothing = true; musclesContainer.addChild(musclesImage); contentContainer.addChild(musclesContainer); } function loadMusclesVideo():void { connection.connect(null); stream = new NetStream(connection); stream.client = this; musclesVideo.mask = musclesBitmapData; stage.addChild(musclesVideo); musclesVideo.attachNetStream(stream); stream.bufferTime = 1; stream.receiveAudio(true); stream.receiveVideo(true); stream.play("vid/muscles.flv"); } Outside this code I have a function that adds the containers to the stage, etc and places the objects in the appropriate spots. It sort of works - the mask applies, but in a square (the size of the boundaries of musclesBitmapData) rather than with the shape of the alpha channel. Is this the right way to go about this?

    Read the article

  • Unable to load images into each MC?

    - by Hwang
    The images only loads into the last MC, how to make it load into each MC? private function imageHandler():void { imageBox=new MovieClip(); imageBox.graphics.lineStyle(5, 0xFFFFFF); imageBox.graphics.beginFill(0xFF0000); imageBox.graphics.drawRect(0,0,150,225); imageBox.graphics.endFill(); allImage.addChild(imageBox); } private function getPhoto():void { for (i=0; i<myXMLList.length(); i++) { placePhoto(); imageHandler(); imagesArray.push(imageBox); imagesArray[i].x=20+(200*i); } addChild(allImage); allImage.x=-(allImage.width+20); allImage.y=-(allImage.height+50); } private function placePhoto():void { loadedPic=myXMLList[i].@PIC; galleryLoader = new Loader(); galleryLoader.load(new URLRequest(loadedPic)); galleryLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,picLoaded); } private function picLoaded(event:Event):void { bmp=new Bitmap(event.target.content.bitmapData); bmp.smoothing=true; imageBox.addChild(bmp); }

    Read the article

  • Getting each loaded image

    - by Hwang
    The images only loads into the last MC, how to make it load into each MC? private function imageHandler():void { imageBox=new MovieClip(); imageBox.graphics.lineStyle(5, 0xFFFFFF); imageBox.graphics.beginFill(0xFF0000); imageBox.graphics.drawRect(0,0,150,225); imageBox.graphics.endFill(); allImage.addChild(imageBox); } private function getPhoto():void { for (i=0; i<myXMLList.length(); i++) { placePhoto(); imageHandler(); imagesArray.push(imageBox); imagesArray[i].x=20+(200*i); } addChild(allImage); allImage.x=-(allImage.width+20); allImage.y=-(allImage.height+50); } private function placePhoto():void { loadedPic=myXMLList[i].@PIC; galleryLoader = new Loader(); galleryLoader.load(new URLRequest(loadedPic)); galleryLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,picLoaded); } private function picLoaded(event:Event):void { var bmpD=event.target.content.bitmapData for (j; j<myXMLList.length(); j++) { bmp=new Bitmap(bmpD); bmp.smoothing=true; bmp.name="bmp"+j; imagesArray[j].addChild(bmp); } }

    Read the article

  • Flash as3 smooth threshold

    - by arkzai
    hello, I'm building a flash app that pulls images from flickr and removes the white background I'm dong this using threshold and i get a really ragged outcome is there any way to get a better and smoother color key? thanks photoNumber = Math.floor(Math.random() * (photos.length)); loader.load(new URLRequest(photos[photoNumber].path)); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,draw); trace ( "trying to load photo " + photoNumber ); function draw(e:Event) { trace ("show photo " + photoNumber) var W:int=e.target.content.width; var H:int=e.target.content.height; bitmapdata=new BitmapData(W,H); bitmap=new Bitmap(bitmapdata); bitmapdata.draw(e.target.content); var threshold:uint = 0xF9F8F800; var color:uint = 0x00000000; var maskColor:uint = 0x00FF0000; bitmapdata.threshold(bitmapdata,new Rectangle(0,0,W,H),new Point(0,0),">", threshold, color, maskColor, true); bitmap.smoothing = true; //bitmap.scaleX = bitmap.scaleY = 0.99; // <---- imgHolder.addChild(bitmap); } }

    Read the article

  • Using ARIMA to model and forecast stock prices using user-friendly stats program

    - by Brian
    Hi people, Can anyone please offer some insight into this for me? I'm coming from a functional magnetic resonance imaging research background where I analyzed a lot of time series data, and I'd like to analyze the time series of stock prices (or returns) by: 1) modeling a successful stock in a particular market sector and then cross-correlating the time series of this historically successful stock with that of other newer stocks to look for significant relationships; 2) model a stock's price time series and use forecasting (e.g., exponential smoothing) to predict future values of it. I'd like to use non-linear modeling methods (ARIMA and ARCH) to do this. Several questions: How often do ARIMA and ARCH modeling methods (given that the individual who implements them does so accurately) actually fit the stock time series data they target, and what is the optimal fit I can expect? Is the extent to which this model fits the data commensurate with the extent to which it predicts this stock time series' future values? Rather than randomly selecting stocks to compare or model, if profit is my goal, what is an efficient approach, if any, to selecting the stocks I'm going to analyze? Which stats program is the most user-friendly for this? Any thoughts on this would be great and would go a long way for me. Thanks, Brian

    Read the article

  • Curve fitting: Find a CDF (or any function) that satisfies a list of constraints.

    - by dreeves
    I have some constraints on a CDF in the form of a list of x-values and for each x-value, a pair of y-values that the CDF must lie between. We can represent that as a list of {x,y1,y2} triples such as constraints = {{0, 0, 0}, {1, 0.00311936, 0.00416369}, {2, 0.0847077, 0.109064}, {3, 0.272142, 0.354692}, {4, 0.53198, 0.646113}, {5, 0.623413, 0.743102}, {6, 0.744714, 0.905966}} Graphically that looks like this: And since this is a CDF there's an additional implicit constraint of {Infinity, 1, 1} Ie, the function must never exceed 1. Also, it must be monotone. Now, without making any assumptions about its functional form, we want to find a curve that respects those constraints. For example: (I cheated to get that one: I actually started with a nice log-normal distribution and then generated fake constraints based on it.) One possibility is a straight interpolation through the midpoints of the constraints: mids = ({#1, Mean[{#2,#3}]}&) @@@ constraints f = Interpolation[mids, InterpolationOrder->0] Plotted, f looks like this: That sort of technically satisfies the constraints but it needs smoothing. We can increase the interpolation order but now it violates the implicit constraints (always less than one, and monotone): How can I get a curve that looks as much like the first one above as possible? Note that NonLinearModelFit with a LogNormalDistribution will do the trick in this example but is insufficiently general as sometimes there will sometimes not exist a log-normal distribution satisfying the constraints.

    Read the article

  • movie does not start in full screen in flash video player

    - by jodeci
    We have this legacy code of a flash video player that functions well enough but still has some loose ends I need to tighten up. It can do the basic "switch to full screen and back to normal size" stunts, however with one exception. On the first fresh load of the app, if I switch to full screen mode first, and then click to play the movie, the player would be in full screen, yet the movie itself would remain in it's original size. //trigger if (stage.displayState == StageDisplayState.NORMAL) { stage.addEventListener('fullScreen', procFullScreen); stage.scaleMode = StageScaleMode.NO_SCALE; stage.displayState = StageDisplayState.FULL_SCREEN; //mv:VideoDisplay mv.percentHeight = 100; mv.percentWidth = 100; mv.x = 0; mv.y = 0; } // event handler if (event.fullScreen) { mv.smoothing = true; this.height = stage.height; this.width = stage.width; //videoCanvas:Canvas videoCanvas.height = Application.application.height; videoCanvas.width = Application.application.width; fullScreenViewStack.selectedIndex = 1; } The VideoDisplay object even returns the expected width/height, but the movie just plays in it's original size. If I switch screen sizes during movie playback, then the movie size will shrink or stretch as it should. I'm running out of ideas, any suggestions? Thanks in advance!

    Read the article

  • I need to Loop an a formula with the Offset function until the cell is blank

    - by CEMG
    I need to Loop the formula below until Column "B" which contains dates is empty. I am stuck and I just can't seem to write the VBA Code to do the Loop until there is no more Dates in Column "B". The formula is smoothing out the yields by using those dates that have a yield. I hope anyone would be able to help me. Thanks in advance A B C D 5 Factor Date Yield Input 6 3 May-10 .25 7 1 Jun-10 8 2 Jul-10 9 3 Aug-10 0.2000 10 1 Sep-10 11 2 Oct-10 12 3 Nov-10 0.2418 13 1 Dec-10 14 2 Jan-11 15 3 Feb-11 0.3156 16 1 Mar-11 17 2 Apr-11 . Sub IsNumeric() 'IF(ISNUMBER(C6),C6, If Application.IsNumber(range("c6").Value) Then range("d6").Value = range("c6") 'IF(C6<C5,((OFFSET(C6,2,0)-OFFSET(C6,-1,0))*A6/3+OFFSET(C6,-1,0)), If range("c6").Select < range("c5").Select Then range("d6").Value = range("c6").Offset(2, 0).Select - range("c6").Offset(-1, 0).Select * (range("a6").Select / 3) + range("c6").Offset(-1, 0).Select 'IF(C6<>C7,((OFFSET(C6,1,0)-OFFSET(C6,-2,0))*(A6/3)+OFFSET(C6,-2,0)),""))) If range("c6").Select <> range("c7").Select Then range("d6").Value = (range("c6").Offset(1, 0).Select) - range("c6").Offset(-2, 0).Select * (range("a6").Select / 3) + range("c6").Offset(-2, 0).Select Else range("d6").Value = "" End If End If End If End Sub

    Read the article

  • i integer does not +1 the 1st time

    - by Hwang
    I have a gallery where it will load an image after a previous image is loaded, so every time 'i' will +1 so that it could move to the next image. This code works fine on my other files, but I dunno why it doesn't work for the current file. Normally if I trace 'i' the correct will be 0,1,2,3,4,5,6... etc adding on till the limit, but this files its 'i' repeat the 1st number twice, only it continues to add 0,0,1,2,3,4,5,6...etc The code is completely the same with the other file I'm using, but I don't know why it just doesn't work here. The code does not seems to have any problem. Anyway i can work around this situation? private var i:uint=0; private function loadItem():void { if (i<myXMLList.length()) { loadedPic=myXMLList[i].thumbnails; galleryLoader = new Loader(); galleryLoader.load(new URLRequest(loadedPic)); galleryLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,picLoaded); } else { adjustImage(); } } private function picLoaded(event:Event):void { var bmp=new Bitmap(event.target.content.bitmapData); bmp.smoothing=true; bmpArray.push(bmp); imagesArray[i].addChild(bmp); i++; loadItem(); }

    Read the article

  • Setting pixel values in Nvidia NPP ImageCPU objects?

    - by solvingPuzzles
    In the Nvidia Performance Primitives (NPP) image processing examples in the CUDA SDK distribution, images are typically stored on the CPU as ImageCPU objects, and images are stored on the GPU as ImageNPP objects. boxFilterNPP.cpp is an example from the CUDA SDK that uses these ImageCPU and ImageNPP objects. When using a filter (convolution) function like nppiFilter, it makes sense to define a filter as an ImageCPU object. However, I see no clear way setting the values of an ImageCPU object. npp::ImageCPU_32f_C1 hostKernel(3,3); //allocate space for 3x3 convolution kernel //want to set hostKernel to [-1 0 1; -1 0 1; -1 0 1] hostKernel[0][0] = -1; //this doesn't compile hostKernel(0,0) = -1; //this doesn't compile hostKernel.at(0,0) = -1; //this doesn't compile How can I manually put values into an ImageCPU object? Notes: I didn't actually use nppiFilter in the code snippet; I'm just mentioning nppiFilter as a motivating example for writing values into an ImageCPU object. The boxFilterNPP.cpp example doesn't involve writing directly to an ImageCPU object, because nppiFilterBox is a special case of nppiFilter that uses a built-in gaussian smoothing filter (probably something like [1 1 1; 1 1 1; 1 1 1]).

    Read the article

  • Flash -> ByteArray -> AMFPHP -> Invalid Image !??

    - by undefined
    Hi, Im loading images into Flash and using JPGEncoder to encode the image to a ByteArray and send this to AMF PHP which writes out the bytearray to a file. This all appears to work correctly and I can download the resulting file in Photoshop CS4 absolutely fine. When i try to open it from the desktop or open it back in Flash it doesnt work... Picasa my default image browser says "Invalid" Here is the code i use to write the bytearray to a file - $jpg = $GLOBALS["HTTP_RAW_POST_DATA"]; file_put_contents($filename, $jpg); That's it ... I use the NetConnection class to connect and call the service, do I need to say Im sending jpg data? I assumed that JPGEncoder took care of that. How can I validate the bytearray before writing the file? Do I need to set MIME type or something .. excuse the slightly noob questions, a little knowledge can be a dangerous thing. Thanks --------------------------------------- PART II ------------------------------------------ Here is some code - 1) load the image into Flash player item.load(); function _onImageDataLoaded(evt:Event):void { var tmpFileRef:FileReference=FileReference(evt.target); image_loader=new Loader ; image_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, _onImageLoaded); image_loader.loadBytes(tmpFileRef.data); } function _onImageLoaded(evt:Event):void { bitmap=Bitmap(evt.target.content); bitmap.smoothing=true; if (bitmap.width>MAX_WIDTH||bitmap.height>MAX_HEIGHT) { resizeBitmap(bitmap); } uploadResizedImage(bitmap); } function resizeBitmap(target:Bitmap):void { if (target.height>target.width) { target.width=MAX_WIDTH; target.scaleY=target.scaleX; } else if (target.width >= target.height) { target.height=MAX_HEIGHT; target.scaleX=target.scaleY; } } function uploadResizedImage(target:Bitmap):void { var _bmd:BitmapData=new BitmapData(target.width,target.height); _bmd.draw(target, new Matrix(target.scaleX, 0, 0, target.scaleY)); var encoded_jpg:JPGEncoder=new JPGEncoder(90); var jpg_binary:ByteArray=encoded_jpg.encode(_bmd); _uploadService=new NetConnection(); _uploadService.objectEncoding=ObjectEncoding.AMF3 _uploadService.connect("http://.../amfphp/gateway.php"); _uploadService.call("UploadService.receiveByteArray",new Responder(success, error), jpg_binary, currentImageFilename); } Many thanks for you help

    Read the article

  • SilverLight 3 Beginner question: Scroll with mousewheel and zoom image with panning

    - by JP Hellemons
    Hello, I would like to make a small silverlight app which displays one fairly large image which can be zoomed in by scrolling the mouse and then panned with the mouse. it's similar to the function in google maps and i do not want to use deepzoom. here is what i have at the moment. please keep in mind that this is my first silverlight app: this app is just for me to see it's a good way to build in a website. so it's a demo app and therefor has bad variable names. the initial image is 1800px width. private void sc_MouseWheel(object sender, MouseWheelEventArgs e) { var st = (ScaleTransform)plaatje.RenderTransform; double zoom = e.Delta > 0 ? .1 : -.1; st.ScaleX += zoom; st.ScaleY += zoom; } this works, but could use some smoothing and it's positioned top left and not centered. the panning is like this: found it @ http://stackoverflow.com/questions/741956/wpf-pan-zoom-image and converted it to this below to work in silverlight Point start; Point origin; bool captured = false; private void plaatje_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { plaatje.CaptureMouse(); captured = true; var tt = (TranslateTransform)((TransformGroup)plaatje.RenderTransform) .Children.First(tr => tr is TranslateTransform); start = e.GetPosition(canvasje); origin = new Point(tt.X, tt.Y); } private void plaatje_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { plaatje.ReleaseMouseCapture(); captured = false; } private void plaatje_MouseMove(object sender, MouseEventArgs e) { if (!captured) return; var tt = (TranslateTransform)((TransformGroup)plaatje.RenderTransform).Children.First(tr => tr is TranslateTransform); double xVerschuiving = start.X - e.GetPosition(canvasje).X; double yVerschuiving = start.Y - e.GetPosition(canvasje).Y; tt.X = origin.X - xVerschuiving; tt.Y = origin.Y - yVerschuiving; } so the scaling isn't smooth and the panning isn't working, because when i click it, the image disappears. thanks in advanced!

    Read the article

  • Error using `loess.smooth` but not `loess` or `lowess`

    - by Sandy
    I need to smooth some simulated data, but occasionally run into problems when the simulated ordinates to be smoothed are mostly the same value. Here is a small reproducible example of the simplest case. > x <- 0:50 > y <- rep(0,51) > loess.smooth(x,y) Error in simpleLoess(y, x, w, span, degree, FALSE, FALSE, normalize = FALSE, : NA/NaN/Inf in foreign function call (arg 1) loess(y~x), lowess(x,y), and their analogue in MATLAB produce the expected results without error on this example. I am using loess.smooth here because I need the estimates evaluated at a set number of points. According to the documentation, I believe loess.smooth and loess are using the same estimation functions, but the former is an "auxiliary function" to handle the evaluation points. The error seems to come from a C function: > traceback() 3: .C(R_loess_raw, as.double(pseudovalues), as.double(x), as.double(weights), as.double(weights), as.integer(D), as.integer(N), as.double(span), as.integer(degree), as.integer(nonparametric), as.integer(order.drop.sqr), as.integer(sum.drop.sqr), as.double(span * cell), as.character(surf.stat), temp = double(N), parameter = integer(7), a = integer(max.kd), xi = double(max.kd), vert = double(2 * D), vval = double((D + 1) * max.kd), diagonal = double(N), trL = double(1), delta1 = double(1), delta2 = double(1), as.integer(0L)) 2: simpleLoess(y, x, w, span, degree, FALSE, FALSE, normalize = FALSE, "none", "interpolate", control$cell, iterations, control$trace.hat) 1: loess.smooth(x, y) loess also calls simpleLoess, but with what appears to be different arguments. Of course, if you vary enough of the y values to be nonzero, loess.smooth runs without error, but I need the program to run in even the most extreme case. Hopefully, someone can help me with one and/or all of the following: Understand why only loess.smooth, and not the other functions, produces this error and find a solution for this problem. Find a work-around using loess but still evaluating the estimate at a specified number of points that can differ from the vector x. For example, I might want to use only x <- seq(0,50,10) in the smoothing, but evaluate the estimate at x <- 0:50. As far as I know, using predict with a new data frame will not properly handle this situation, but please let me know if I am missing something there. Handle the error in a way that doesn't stop the program from moving onto the next simulated data set. Thanks in advance for any help on this problem.

    Read the article

  • save button error in AS project

    - by Rajeev
    Whats wrong with the following code,There is an error at saveButton.visible = false; discardButton.visible = false; package { import flash.display.Sprite; import flash.media.Camera; import flash.media.Video; import flash.display.BitmapData; import flash.display.Bitmap; import flash.events.MouseEvent; import flash.net.FileReference; import flash.utils.ByteArray; import com.adobe.images.JPGEncoder; public class caml extends Sprite { private var camera:Camera = Camera.getCamera(); private var video:Video = new Video(); private var bmd:BitmapData = new BitmapData(320,240); private var bmp:Bitmap; private var fileReference:FileReference = new FileReference(); private var byteArray:ByteArray; private var jpg:JPGEncoder = new JPGEncoder(); public function caml() { saveButton.visible = false; discardButton.visible = false; saveButton.addEventListener(MouseEvent.MOUSE_UP, saveImage); discardButton.addEventListener(MouseEvent.MOUSE_UP, discard); capture.addEventListener(MouseEvent.MOUSE_UP, captureImage); if (camera != null) { video.smoothing = true; video.attachCamera(camera); video.x = 140; video.y = 40; addChild(video); } else { trace("No Camera Detected"); } } private function captureImage(e:MouseEvent):void { bmd.draw(video); bmp = new Bitmap(bmd); bmp.x = 140; bmp.y = 40; addChild(bmp); capture.visible = false; saveButton.visible = true; discardButton.visible = true; } private function saveImage(e:MouseEvent):void { byteArray = jpg.encode(bmd); fileReference.save(byteArray, "Image.jpg"); removeChild(bmp); saveButton.visible = false; discardButton.visible = false; capture.visible = true; } private function discard(e:MouseEvent):void { removeChild(bmp); saveButton.visible = false; discardButton.visible = false; capture.visible = true; } } }

    Read the article

  • Upload picture directly to the server

    - by Rajeev
    In the following link http://www.tuttoaster.com/create-a-camera-application-in-flash-using-actionscript-3/ how to make the picture upload directly to the server after taking a picture from webcam package { import flash.display.Sprite; import flash.media.Camera; import flash.media.Video; import flash.display.BitmapData; import flash.display.Bitmap; import flash.events.MouseEvent; import flash.net.FileReference; import flash.utils.ByteArray; import com.adobe.images.JPGEncoder; public class caml extends Sprite { private var camera:Camera = Camera.getCamera(); private var video:Video = new Video(); private var bmd:BitmapData = new BitmapData(320,240); private var bmp:Bitmap; private var fileReference:FileReference = new FileReference(); private var byteArray:ByteArray; private var jpg:JPGEncoder = new JPGEncoder(); public function caml() { saveButton.visible = false; discardButton.visible = false; saveButton.addEventListener(MouseEvent.MOUSE_UP, saveImage); discardButton.addEventListener(MouseEvent.MOUSE_UP, discard); capture.addEventListener(MouseEvent.MOUSE_UP, captureImage); if (camera != null) { video.smoothing = true; video.attachCamera(camera); video.x = 140; video.y = 40; addChild(video); } else { trace("No Camera Detected"); } } private function captureImage(e:MouseEvent):void { bmd.draw(video); bmp = new Bitmap(bmd); bmp.x = 140; bmp.y = 40; addChild(bmp); capture.visible = false; saveButton.visible = true; discardButton.visible = true; } private function saveImage(e:MouseEvent):void { byteArray = jpg.encode(bmd); fileReference.save(byteArray, "Image.jpg"); removeChild(bmp); saveButton.visible = false; discardButton.visible = false; capture.visible = true; } private function discard(e:MouseEvent):void { removeChild(bmp); saveButton.visible = false; discardButton.visible = false; capture.visible = true; } } }

    Read the article

  • MIX 2010 Covert Operations Day 2 Silverlight + Windows 7 Phone

    - by GeekAgilistMercenary
    Left the Circus Circus and headed to the geek circus at Mandalay Bay.  Got in, got some breakfast, met a few more people and headed to the keynote. Upon arriving the crew I was hanging with at the event; Erik Mork, Beth Murray, and Brian Henderson and I were entertained with several other thousand geeks by the wicked yo-yoing. The first video demo of something was of Bing Maps and various aspects of Microsoft Research integrated together.  Namely the pictures, put in place, on real 3d element maps of various environments. Silverlight Scott Guthrie, as one would guess, kicked off the keynote.  His first point was that user experience has become a priority at Microsoft.  This can be seen by any observant soul with the release and push of Expression, Silverlight, and the other tools.  This is even more apparent when one takes note of Microsoft bringing in people that can actually do good design and putting them at the forefront. The next thing Scott brought up was a few key points about Silverlight.  Currently Silverlight is a little over 2 years old and has achieved a pretty solid 60% penetration.  Silverlight has all sorts of capabilities that have been developed and are now provided as open source including;  ad injection, smoothing, playback editing, and more.  Another thing he showed, which really struck me as awesome being in the analytics space, was the Olympics and a quick glimpse of the ad statistics, viewer experience, video playback performance, audience trends, and overall viewer participation.  All of it rendered in Silverlight in beautiful detail. The key piece of Scott's various points were all punctuated with the fact that all of this code is available as open source.  Not only is Microsoft really delving into this design element of things, they're getting involved in the right ways. One of the last points I'll bring up about Silverlight 4 is the ability to have HD video on a monitor, and an entirely different activity being done on the other monitor, effectively making Silverlight the only RIA framework that supports multi-monitor support.  Overall, Silverlight is continuing to impress – providing superior capabilities tit-for-tat with the competition. Windows 7 Phone The Windows 7 Phone has 3 primary buttons (yes, more than the iPhone, don't let your mind explode!!).  Start, Search, and Back control all of the needed functionality of the phone.  At the same time, of course, there is the multi-touch, touch, and other interactive abilities of the interface.  The intent, once start is pressed is to have all the information that a phone owner wants displayed immediately.  Avoiding the scrolling through pages of apps or rolling a ball to get through multitudes of other non-interactive phone interfaces.  The Windows 7 Phone simply has the data right in front of you, basically a phone dashboard.  From there it is easy to dive into the interactive areas of the phone. Each area of the interface of the phone is broken into hubs.  These hubs include applications, data, and other things based on a relative basis.  This basis being determined by the user.  These applications interact on many other levels, and form a kind of relationship between each other adding more and more meta-data to the phone user, their interactions between the applications, and of course the social element of their interactions on the phone.  This makes this phone a practical must have for a marketer involved in social media.  The level of wired together interaction is massive, and of course, if you've seen Office Outlook 2010 you know that the power that is pulled into the phone by being tied to Outlook is massive. Joe Belfiore also showed several UI & specifically UX elements of the phone interface that allows paging to be instinctual by simple clipped items, flipping page to page, and other excellent user experience advances for phone devices.  Belfiore's also showed how his people hub had a massive list of people, with pictures, all from various different social networks and other associated relations.  The rendering, speed, and viewing of these people's, their pictures, their social network information, and other characteristics was smooth and in some situations unbelievably rendered.  This demo showed some of the great power of the beta phone, which isn't even as powerful as the planned end device. Joe finished up by jumping into the music, videos, and other media with the Zune Component of the Windows 7 Mobile Phone.  This was all good stuff, but I'll get to what really sold me on the media element in a moment. When Joe was done, Scott Guthrie stepped back up to walk through building a Windows 7 Mobile Phone.  This is were I have to give serious props.  He built this application, in Visual Studio 2010, in front of 2000+ people.  That was cool, but what really was amazing that he build the application in about 2 minutes.  The IDE, side by side design that is standard in Visual Studio is light years ahead of x-Code or any of the iPhone IDEs.  The Windows 7 Mobile System, if it can get market penetration, poses a technologically superior development and phone platform over anything on the market right now.  The biggest problem with the phone, is it just isn't available yet.  I personally can't wait for a chance to build some apps for the new Windows Phone. Netflix, I May Start Up an Account Again! When I get my Windows 7 Phone device, I am absolutely getting a Netflix account again.  The Vertigo crew, as I wrote on Twitter "#MIX10 Props @seesharp on @netflix demo", displayed an application on the phone for Netflix that actually ran HD Video of Rescue Me (with Dennis Leary).  The video played back smooth as it would on a dedicated computer, I was instantly sold.  So this didn't actually sell me on the phone, because I'm already sold, but it did sell me whole heartedly on the media capabilities of the pending phone. Anyway, I try not to do this but I may double post today.  Lunch is over and I'm off to another session very near and dear to the heart of my occupation, Analytics Tracking.  Stay tuned and I should have that post up by the end of the day. Original Post – Check out my other blog for even more technical ramblings and reads.

    Read the article

  • Disable antialiasing for a specific GDI device context

    - by Jacob Stanley
    I'm using a third party library to render an image to a GDI DC and I need to ensure that any text is rendered without any smoothing/antialiasing so that I can convert the image to a predefined palette with indexed colors. The third party library i'm using for rendering doesn't support this and just renders text as per the current windows settings for font rendering. They've also said that it's unlikely they'll add the ability to switch anti-aliasing off any time soon. The best work around I've found so far is to call the third party library in this way (error handling and prior settings checks ommitted for brevity): private static void SetFontSmoothing(bool enabled) { int pv = 0; SystemParametersInfo(Spi.SetFontSmoothing, enabled ? 1 : 0, ref pv, Spif.None); } // snip Graphics graphics = Graphics.FromImage(bitmap) IntPtr deviceContext = graphics.GetHdc(); SetFontSmoothing(false); thirdPartyComponent.Render(deviceContext); SetFontSmoothing(true); This obviously has a horrible effect on the operating system, other applications flicker from cleartype enabled to disabled and back every time I render the image. So the question is, does anyone know how I can alter the font rendering settings for a specific DC? Even if I could just make the changes process or thread specific instead of affecting the whole operating system, that would be a big step forward! (That would give me the option of farming this rendering out to a separate process- the results are written to disk after rendering anyway) EDIT: I'd like to add that I don't mind if the solution is more complex than just a few API calls. I'd even be happy with a solution that involved hooking system dlls if it was only about a days work. EDIT: Background Information The third-party library renders using a palette of about 70 colors. After the image (which is actually a map tile) is rendered to the DC, I convert each pixel from it's 32-bit color back to it's palette index and store the result as an 8bpp greyscale image. This is uploaded to the video card as a texture. During rendering, I re-apply the palette (also stored as a texture) with a pixel shader executing on the video card. This allows me to switch and fade between different palettes instantaneously instead of needing to regenerate all the required tiles. It takes between 10-60 seconds to generate and upload all the tiles for a typical view of the world. EDIT: Renamed GraphicsDevice to Graphics The class GraphicsDevice in the previous version of this question is actually System.Drawing.Graphics. I had renamed it (using GraphicsDevice = ...) because the code in question is in the namespace MyCompany.Graphics and the compiler wasn't able resolve it properly. EDIT: Success! I even managed to port the PatchIat function below to C# with the help of Marshal.GetFunctionPointerForDelegate. The .NET interop team really did a fantastic job! I'm now using the following syntax, where Patch is an extension method on System.Diagnostics.ProcessModule: module.Patch( "Gdi32.dll", "CreateFontIndirectA", (CreateFontIndirectA original) => font => { font->lfQuality = NONANTIALIASED_QUALITY; return original(font); }); private unsafe delegate IntPtr CreateFontIndirectA(LOGFONTA* lplf); private const int NONANTIALIASED_QUALITY = 3; [StructLayout(LayoutKind.Sequential)] private struct LOGFONTA { public int lfHeight; public int lfWidth; public int lfEscapement; public int lfOrientation; public int lfWeight; public byte lfItalic; public byte lfUnderline; public byte lfStrikeOut; public byte lfCharSet; public byte lfOutPrecision; public byte lfClipPrecision; public byte lfQuality; public byte lfPitchAndFamily; public unsafe fixed sbyte lfFaceName [32]; }

    Read the article

  • Using methods on 2 input files - 2nd is printing multiple times - Java

    - by Aaa
    I have the following code to read in text, store in a hashmap as bigrams (with other methods to sort them by frequency and do v. v. basic additive smoothing. I had it working great for one language input file (english) and then I want to expand it for the second language input file (japanese - doens;t matter what it is I suppose) using the same methods but the Japanese bigram hashmap is printing out 3 times in a row with diff. values. I've tried using diff text in the input file, making sure there are no gaps in text etc. I've also put print statements at certain places in the Japanese part of the code to see if I can get any clues but all the print statements are printing each time so I can't work out if it is looping at a certain place. I have gone through it with a fine toothcomb but am obviously missing something and slowly going crazy here - any help would be appreciated. thanks in advance... package languagerecognition2; import java.lang.String; import java.io.InputStreamReader; import java.util.*; import java.util.Iterator; import java.util.List.*; import java.util.ArrayList; import java.util.AbstractMap.*; import java.lang.Object; import java.io.*; import java.util.Enumeration; import java.util.Arrays; import java.lang.Math; public class Main { /** public static void main(String[] args) { //training English ----------------------------------------------------------------- File file = new File("english1.txt"); StringBuffer contents = new StringBuffer(); BufferedReader reader = null; try { reader = new BufferedReader(new FileReader(file)); String test = null; //test = reader.readLine(); // repeat until all lines are read while ((test = reader.readLine()) != null) { test = test.toLowerCase(); char[] charArrayEng = test.toCharArray(); HashMap<String, Integer> hashMapEng = new HashMap<String, Integer>(bigrams(charArrayEng)); LinkedHashMap<String, Integer> sortedListEng = new LinkedHashMap<String, Integer>(sort(hashMapEng)); int sizeEng=sortedListEng.size(); System.out.println("Total count of English bigrams is " + sizeEng); LinkedHashMap<String, Integer> smoothedListEng = new LinkedHashMap<String, Integer>(smooth(sortedListEng, sizeEng)); //print linkedHashMap to check values Set set= smoothedListEng.entrySet(); Iterator iter = set.iterator ( ) ; System.out.println("Beginning English"); while ( iter.hasNext()) { Map.Entry entry = ( Map.Entry ) iter.next ( ) ; Object key = entry.getKey ( ) ; Object value = entry.getValue ( ) ; System.out.println( key+" : " + value); } System.out.println("End English"); }//end while }//end try catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader != null) { reader.close(); } } catch (IOException e) { e.printStackTrace(); } } //End training English----------------------------------------------------------- //Training japanese-------------------------------------------------------------- File file2 = new File("japanese1.txt"); StringBuffer contents2 = new StringBuffer(); BufferedReader reader2 = null; try { reader2 = new BufferedReader(new FileReader(file2)); String test2 = null; //repeat until all lines are read while ((test2 = reader2.readLine()) != null) { test2 = test2.toLowerCase(); char[] charArrayJap = test2.toCharArray(); HashMap<String, Integer> hashMapJap = new HashMap<String, Integer>(bigrams(charArrayJap)); //System.out.println( "bigrams stage"); LinkedHashMap<String, Integer> sortedListJap = new LinkedHashMap<String, Integer>(sort(hashMapJap)); //System.out.println( "sort stage"); int sizeJap=sortedListJap.size(); //System.out.println("Total count of Japanese bigrams is " + sizeJap); LinkedHashMap<String, Integer> smoothedListJap = new LinkedHashMap<String, Integer>(smooth(sortedListJap, sizeJap)); System.out.println( "smooth stage"); //print linkedHashMap to check values Set set2= smoothedListJap.entrySet(); Iterator iter2 = set2.iterator(); System.out.println("Beginning Japanese"); while ( iter2.hasNext()) { Map.Entry entry2 = ( Map.Entry ) iter2.next ( ) ; Object key = entry2.getKey ( ) ; Object value = entry2.getValue ( ) ; System.out.println( key+" : " + value); }//end while System.out.println("End Japanese"); }//end while }//end try catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (reader2 != null) { reader2.close(); } } catch (IOException e) { e.printStackTrace(); } } //end training Japanese--------------------------------------------------------- } //end main (inner)

    Read the article

< Previous Page | 1 2 3 4  | Next Page >