Search Results

Search found 1513 results on 61 pages for 'canvas'.

Page 4/61 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • (CanvsEngine) Collission problem ( TypeError: this._polygon[this._frame] is undefined) [on hold]

    - by user2127102
    How can i fix this error TypeError: this._polygon[this._frame] is undefined Heres my code: html: <!DOCTYPE Html> <head> <meta charset="utf-8"> <title>Project</title> <link href="css/style.css" rel="stylesheet"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> <script src="js/canvasengine-1.3.0.all.min.js"></script> <script src="js/extends/Input.js"></script> <script src="main.js"></script> </head> <body> <canvas id="window"></canvas> </body> main.js: var canvas = CE.defines("window"). extend(Input). ready(function() { canvas.Scene.call("Game"); }); canvas.Scene.new({ name: "Game", materials: { images: { player: "img/character.png", Wall: "img/TestWall.png" } }, ready: function(stage) { var _canvas = this.getCanvas(); _canvas.setSize("browser", "strech"); this.Player = Class.new("Entity", [stage]); this.Player.el.drawImage("player"); stage.append(this.Player.el); this.Wall = Class.new("Entity", [stage]); this.Wall.el.drawImage("Wall"); this.Wall.position(300, 0); stage.append(this.Wall.el); }, render: function(stage) { //Controls ====== //Control calculations var self = this; this.Mover_A; this.Mover_D; this.Mover_W; this.Mover_S; canvas.Input.keyDown(Input.A, function(e) { self.Mover_A = true; }); canvas.Input.keyDown(Input.D, function(e) { self.Mover_D = true; }); canvas.Input.keyDown(Input.W, function(e) { self.Mover_W = true; }); canvas.Input.keyDown(Input.S, function(e) { self.Mover_S = true; console.log(self.Mover_S); }); canvas.Input.keyUp(Input.A, function(e) { self.Mover_A = false; }); canvas.Input.keyUp(Input.D, function(e) { self.Mover_D = false; }); canvas.Input.keyUp(Input.W, function(e) { self.Mover_W = false; }); canvas.Input.keyUp(Input.S, function(e) { self.Mover_S = false; }); x = 0; y = 0; if(this.Mover_A)x -= 1.5; //A if(this.Mover_D)x += 1.5;//D if(this.Mover_W)y -= 1.5;//W if(this.Mover_S)y += 1.5; //S this.Player.move(x, y); this.Player.hit("over", [this.Wall], function(state, el) { this.Player.move(x * -1, y * -1); }); //End Controls ===== stage.refresh(); } });

    Read the article

  • How to remove an object from the canvas?

    - by Marius Jonsson
    Hello there, I am making this script that will rotate a needle on a tachometer using canvas. I am a newbie to this canvas. This is my code: function startup() { var canvas = document.getElementById('canvas'); var context = canvas.getContext('2d'); var meter = new Image(); meter.src = 'background.png'; var pin = new Image(); pin.src = 'needle.png'; context.drawImage(meter,0,0); context.translate(275,297); for (var frm = 0; frm < 6000; frm++){ var r=frm/1000; //handle here var i=r*36-27; //angle of rotation from value of r and span var angleInRadians = 3.14159265 * i/180; //converting degree to radian context.rotate(angleInRadians); //rotating by angle context.drawImage(pin,-250,-3); //adjusting pin center at meter center } } Here is the script in action: http://www.kingoslo.com/instruments/ The problem is, as you can see, that the red needle is not removed beetween each for-loop. What I need to do is to clear the canvas for the pin object between each cycle of the loop. How do I do this? Thanks. Kind regards, Marius

    Read the article

  • How to -accurately- measure size in pixels of text being drawn on a canvas by drawTextOnPath()

    - by Nick
    I'm using drawTextOnPath() to display some text on a Canvas and I need to know the dimensions of the text being drawn. I know this is not feasible for paths composed of multiple segments, curves, etc. but my path is a single segment which is perfectly horizontal. I am using Paint.getTextBounds() to get a Rect with the dimensions of the text I want to draw. I use this rect to draw a bounding box around the text when I draw it at an arbitrary location. Here's some simplified code that reflects what I am currently doing: // to keep this example simple, always at origin (0,0) public drawBoundedText(Canvas canvas, String text, Paint paint) { Rect textDims = new Rect(); paint.getTextBounds(text,0, text.length(), textDims); float hOffset = 0; float vOffset = paint.getFontMetrics().descent; // vertically centers text float startX = textDims.left; / 0 float startY = textDims.bottom; float endX = textDims.right; float endY = textDims.bottom; path.moveTo(startX, startY); path.lineTo(endX, endY); path.close(); // draw the text canvas.drawTextOnPath(text, path, 0, vOffset, paint); // draw bounding box canvas.drawRect(textDims, paint); } The results are -close- but not perfect. If I replace the second to last line with: canvas.drawText(text, startX, startY - vOffset, paint); Then it works perfectly. Usually there is a gap of 1-3 pixels on the right and bottom edges. The error seems to vary with font size as well. Any ideas? It's possible I'm doing everything right and the problem is with drawTextOnPath(); the text quality very visibly degrades when drawing along paths, even if the path is horizontal, likely because of the interpolation algorithm or whatever its using behind the scenes. I wouldnt be surprised to find out that the size jitter is also coming from there.

    Read the article

  • HTML5: Rendering absolute images using canvas

    - by Mark
    I am experimenting with canvas as part of my HTML5 introduction. This constitutes as assignment work, but I am not asking for any help on the actual coursework at all. I am trying to write a rendering engine, but having no luck because once the image is drawn on canvas it looks very distorted, and not at the right dimensions of the image itself. I have made a animation engine that loads images into an array, and then iterates through them at a certain speed. This is not the problem, and I assume is not causing the issue as this was happening when I drawn an image to the canvas. I think this is natural behaviour for images to be scaled/skewed when the window is resized, so I conquered that by simply redrawing the whole thing once the window is resized. The images I am using are isometric, and drawn at a pixel level. Would this cause the distortion? It seems setting the dimensions on the drawImage() function are not working are all. I am using JavaScript for the manipulation and rendering of the canvas. I would normally try and work it out myself, but I do not have any time to ponder why because I have no idea why it is even scaling/skewing the image once it is drawn on the canvas. I cannot share the code for obvious reasons. I should also mention, the canvas's dimension is the total width of the viewport, as I am developing a game. My question is: Has anyone encountered this and how would I correct it? Thanks for your help.

    Read the article

  • Download Canvas Image Png Chome/Safari

    - by user2639176
    Works in Firefox, and won't work in Safari, or Chrome. function loadimage() { var canvas = document.getElementById("canvas"); if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); xmlhttp2=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp2=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { rasterizeHTML.drawHTML(xmlhttp.responseText, canvas); var t=setTimeout(function(){copy()},3000) } } xmlhttp.open("GET","/sm/<?=$sm[0];?>",true); xmlhttp.send(); } function copy() { var canvas = document.getElementById("canvas"); var img = canvas.toDataURL("image/png"); document.getElementById('dl').href = img; document.getElementById('dl').innerHTML = "Download"; } Now I didn't write this, so I don't know too much javascript. But the script works in Firefox. In Chrome, getting: Uncaught Security Error: An attempt was made to break through the security policy of the user-agent. For toDataURL("image/png")

    Read the article

  • How to update off screen bitmap in a surfaceview thread

    - by DKDiveDude
    I have a Surfaceview thread and an off canvas texture bitmap that is being generated (changed), first row (line), every frame and then copied one position (line) down on regular surfaceview bitmap to make a scrolling effect, and I then continue to draw other things on top of that. Well that is what I really want, however I can't get it to work even though I am creating a separate canvas for off screen bitmap. It is just not scrolling at all. I other words I have a memory bitmap, same size as Surfaceview canvas, which I need to scroll (shift) down one line every frame, and then replace top line with new random texture, and then draw that on regular Surfaceview canvas. Here is what I thought would work; My surfaceChanged where I specify bitmap and canvasses and start thread: @Override public void surfaceCreated(SurfaceHolder holder) { intSurfaceWidth = mSurfaceView.getWidth(); intSurfaceHeight = mSurfaceView.getHeight(); memBitmap = Bitmap.createBitmap(intSurfaceWidth, intSurfaceHeight, Bitmap.Config.ARGB_8888); memCanvas = new Canvas(memCanvas); myThread = new MyThread(holder, this); myThread.setRunning(true); blnPause = false; myThread.start(); } My thread, only showing essential middle running part: @Override public void run() { while (running) { c = null; try { // Lock canvas for drawing c = myHolder.lockCanvas(null); synchronized (mSurfaceHolder) { // First draw off screen bitmap to off screen canvas one line down memCanvas.drawBitmap(memBitmap, 0, 1, null); // Create random one line(row) texture bitmap memTexture = Bitmap.createBitmap(imgTexture, 0, rnd.nextInt(intTextureImageHeight), intSurfaceWidth, 1); // Now add this texture bitmap to top of off screen canvas and hopefully bitmap memCanvas.drawBitmap(textureBitmap, intSurfaceWidth, 0, null); // Draw above updated off screen bitmap to regular canvas, at least I thought it would update (save changes) shifting down and add the texture line to off screen bitmap the off screen canvas was pointing to. c.drawBitmap(memBitmap, 0, 0, null); // Other drawing to canvas comes here } finally { // do this in a finally so that if an exception is thrown // during the above, we don't leave the Surface in an // inconsistent state if (c != null) { myHolder.unlockCanvasAndPost(c); } } } } For my game Tunnel Run. Right now I have a working solution where I instead have an array of bitmaps, size of surface height, that I populate with my random texture and then shift down in a loop for each frame. I get 50 frames per second, but I think I can do better by instead scrolling bitmap.

    Read the article

  • Android: how to place a button at an x,y position over top of Canvas

    - by Ben Mc
    Is it possible to place buttons at an X,Y position over the top of a Canvas? For example, on the opening screen of my game, I would like to place buttons for "Play Now", "Instructions", etc, right on top of the canvas. Right now, I'm looking at Touch locations on the Canvas and comparing them to various X,Y bounds. It works, but adding a button with a click listener would probably be much more efficient.

    Read the article

  • Composite operations in Android Canvas

    - by kayahr
    I'm just starting with Android development and I'm coming from JavaScript/HTML world so I'm currently investigating the possibilities of the Android SDK. The HTML 5 canvas supports composite operations (See here). Is this possible in an Android Canvas? I scanned the API of the Canvas class but couldn't find anything useful. I need at least the composite operation "source-in" or (if this isn't possible) "source-atop".

    Read the article

  • HTML5 move Canvas object

    - by Mircea
    Hi, I have 2 canvas created on the same canvas. Is it possible to drag the small black one around? I want to make it draggable but I can not find any online tutorial or demo on this. Is it possible? I had looked to Canvas moveTo or transitions but I was unable to make it work. The code is here http://jsfiddle.net/35P9F/2/ var ctx = document.getElementById('canvas').getContext('2d'); var radgrad3 = ctx.createLinearGradient(255,10,0,180,80,190); radgrad3.addColorStop(0, '#00C9FF'); radgrad3.addColorStop(1, 'red'); ctx.fillStyle = radgrad3; ctx.fillRect(0,0,255,255); var ctx4 = document.getElementById('canvas').getContext('2d'); var radgrad4 = ctx4.createLinearGradient(0, 0, 0, 255); radgrad4.addColorStop(0, '#000000'); radgrad4.addColorStop(1, '#ff0000'); ctx4.fillStyle = radgrad4; ctx4.fillRect(0,0,25,25); Thank you.

    Read the article

  • How to retain canvas state and use it in onDraw() method

    - by marqss
    I want to make a measure tape component for my app. It should look something like this with values from 0cm to 1000cm: Initially I created long bitmap image with repeated tape background. I drew that image to canvas in onDraw() method of my TapeView (extended ImageView). Then I drew a set of numbers with drawText() on top of the canvas. public TapeView(Context context, AttributeSet attrs){ ImageView imageView = new ImageView(mContext); LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT); imageView.setLayoutParams(params); mBitmap = createTapeBitmap(); imageView.setImageBitmap(mBitmap); this.addView(imageView); } private Bitmap createTapeBitmap(){ Bitmap mBitmap = Bitmap.createBitmap(5000, 100, Config.ARGB_8888); //size of the tape Bitmap tape = BitmapFactory.decodeResource(getResources(),R.drawable.tape);//the image size is 100x100px Bitmap scaledTape = Bitmap.createScaledBitmap(tape, 100, 100, false); Canvas c = new Canvas(mBitmap); Paint paint = new Paint(); paint.setColor(Color.WHITE); paint.setFakeBoldText(true); paint.setAntiAlias(true); paint.setTextSize(30); for(int i=0; i<=500; i++){ //draw background image c.drawBitmap(scaledTape,(i * 200), 0, null); //draw number in the middle of that background String text = String.valueOf(i); int textWidth = (int) paint.measureText(text); int position = (i * 100) + 100 - (textWidth / 2); c.drawText(text, position, 20, paint); } return mBitmap; } Finally I added this view to HorizontalScrollView. At the beginning everything worked beautifully but I realised that the app uses a Lot of memory and sometimes crashed with OutOfMemory exception. It was obvious because a size of the bitmap image was ~4mb! In order to increase the performance, instead of creating the bitmap I use Drawable (with the yellow tape strip) and set the tile mode to REPEAT: setTileModeX(TileMode.REPEAT); The view now is very light but I cannot figure out how to add numbers. There are too many of them to redraw them each time the onDraw method is called. Is there any way that I can draw these numbers on canvas and then save that canvas so it can be reused in onDraw() method?

    Read the article

  • Element point map for html5 canvas element, need algorithm

    - by Artiom Chilaru
    I'm currently working on a pure html 5 canvas implementation of the "flying tag cloud sphere", which many of you have undoubtedly seen as a flash object in some pages. The tags are drawn fine, and the performance is satisfactory, but there's one thing in the canvas element that's kind of breaking this idea: you can't identify the objects that you've drawn on a canvas, as it's just a simple flat "image".. What I have to do in this case is catch the click event, and try to "guess" which element was clicked. So I have to have some kind of matrix, which stores a link to a tag object for each pixel on the canvas, AND I have to update this matrix on every redraw. Now this sounds incredibly inefficient, and before I even start trying to implement this, I want to ask the community - is there some "well known" algorithm that would help me in this case? Or maybe I'm just missing something, and the answer is right behind the corner? :)

    Read the article

  • Automated Testing tools for HTML5 Canvas

    - by user432195
    I'm looking for a tool to do some automated GUI testing on a HTML5 canvas component we're developing. Basically I'm looking for a tool that is able to record the clicks and events on the canvas component and is able to replay those events. So far most of the testing tools like Telerik WebUI Testing Suite, Selenium, TestSwarm, qUnit, Jasmine, Hudson seems that they don't fully support HTML5 canvas testing. Would you guys know a testing tool that already supports that ? If not, would you know how companies are doing automated testing of HTML5 canvas ? Thanks, Andy N.

    Read the article

  • Canvas Animation Kit Experiment... ...how to clear the canvas?

    - by Ted Wong
    I can make a obj to use the canvas to draw like this: MyObj.myDiv = new Canvas($("effectDiv"), Setting.width, Setting.height); Then, I use this to draw a rectangle on the canvas: var c = new Rectangle(80, 80, { fill: [220, 40, 90] } ); var move = new Timeline; move.addKeyframe(0, { x: 0, y: 0 } ); c.addTimeline(move); MyObj.myDiv.append(c); But after I draw the rectangle, I want clear the canvas, but I don't know which method and how to do this... ... O...one more thing: it is the CAKE's web site: Link

    Read the article

  • Can ggplot2 work with R's canvas backend

    - by Casbon
    Having installed canvas from here http://www.rforge.net/canvas/files/ I try to plot: > canvas('test.js') > qplot(rnorm(100), geom='histogram') stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust this. Error in grid.Call.graphics("L_setviewport", pvp, TRUE) : Non-finite location and/or size for viewport >

    Read the article

  • Drawing Image onto Canvas Stretches Image?

    - by Fred Finkle
    I have this code (stolen from the web): function readIt() { var reader = new FileReader(); reader.onload = (function(e) { var img = new Image(); img.src = e.target.result; var c = document.getElementById("canvas"); var ctx = c.getContext("2d"); ctx.drawImage(img, 0, 0); } ); reader.readAsDataURL(document.getElementById('userImage').files[0]); } Which works up to a point. The canvas's width and height are set to the size of the image, but only the top left of the image appears - It appears to be stretched so it fits all the space allocated to the canvas (enough to display the whole image - 615px x 615px). If I add an <img> element sized the same size as the canvas and point the src to the image in the file system it appears perfect. I'm using Chrome, but it appears the same in Firefox. Thanks in advance.

    Read the article

  • Two imageViews vs one imageView and a canvas

    - by user3009842
    I have a bitmap and I want to scale it up to fill an ImageView and overlay the unscaled version of the bitmap on top. Which would be cheaper (in terms of memory and processor usage)? Using two ImageViews, one for each version of the bitmap Using a canvas and drawing on the singular bitmap, using one ImageView I saw this question about ImageView vs Canvas, but it doesn't address memory/processor concerns. My intuition says two ImageViews may use more RAM, while using a canvas would use more processing power while the drawing occurs.

    Read the article

  • HTML5 - Creating a canvas on top of an SVG(or other image)

    - by cawd
    The reason for asking this question is because I want to be able to draw an arrow between two svg images. I want to use canvas to create the arrows, so firstly I generate the svgs then place a canvas on top of them to be able to draw the arrows. I've tried using style=... but haven't had any luck as everytime I add the canvas element it just pushes my svg images to another pl If there's no easy way to do this I'll just create arrows using SVG, I figured it would be more efficient to use canvas if I had to do lots of arrows in a short amount of time.

    Read the article

  • Canvas draw calls are rendering out of sequence

    - by Tom Murray
    I have the following code for writing draw calls to a "back buffer" canvas, then placing those in a main canvas using drawImage. This is for optimization purposes and to ensure all images get placed in sequence. Before placing the buffer canvas on top of the main one, I'm using fillRect to create a dark-blue background on the main canvas. However, the blue background is rendering after the sprites. This is unexpected, as I am making its fillRect call first. Here is my code: render: function() { this.buffer.clearRect(0,0,this.w,this.h); this.context.fillStyle = "#000044"; this.context.fillRect(0,0,this.w,this.h); for (var i in this.renderQueue) { for (var ii = 0; ii < this.renderQueue[i].length; ii++) { sprite = this.renderQueue[i][ii]; // Draw it! this.buffer.fillStyle = "green"; this.buffer.fillRect(sprite.x, sprite.y, sprite.w, sprite.h); } } this.context.drawImage(this.bufferCanvas,0,0); } This also happens when I use fillRect on the buffer canvas, instead of the main one. Changing the globalCompositeOperation between 'source-over' and 'destination-over' (for both contexts) does nothing to change this. Paradoxically, if I instead place the blue fillRect inside the nested for loops with the other draw calls, it works as expected... Thanks in advance!

    Read the article

  • Drawning with canvas - problem with sizing [closed]

    - by pioncz
    For example i made 2 canvas with size 500px x 500px and 100px x 100px to see how fillrect works and i found that canvas.fillrect doesnt takes px for arguments, and my question is: how to make pixels as arguments or how to count these arguments for pixels? This is example: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript"> function draw() { var canvas = document.getElementById('myCanvas'); var ctx = canvas.getContext('2d'); ctx.fillStyle = '#00f'; ctx.fillRect (0, 0,100, 100); var canvas2 = document.getElementById('myCanvas2'); var ctx2 = canvas2.getContext('2d'); ctx2.fillStyle = '#0f0'; ctx2.fillRect (0, 0, 100, 100); } </script> </head> <body onLoad="draw();"> <canvas id="myCanvas" style="background:black;width:500px;height:500px;display:block;position:absolute;top:0px;left:0px;"> </canvas> <canvas id="myCanvas2" style="background:purple;width:100px;height:100px;display:block;position:absolute;top:0px;left:0px;"> </canvas> </body> </html>

    Read the article

  • Algorithm to zoom a plotted function

    - by astinx
    I'm making a game in android and I need plot a function, my algorithm is this: @Override protected void onDraw(Canvas canvas) { float e = 0.5f; //from -x axis to +x evaluate f(x) for (float x = -z(canvas.getWidth()); x < z(canvas.getWidth()); x+=e) { float x1,y1; x1 = x; y1 = f(x); canvas.drawPoint((canvas.getWidth()/2)+x1, (canvas.getHeight()/2)-y1, paintWhite); } super.onDraw(canvas); } This is how it works. If my function is, for example f(x)=x^2, then z(x) is sqrt(x). I evaluate each point between -z(x) to z(x) and then I draw them. As you can see I use the half of the size of the screen to put the function in the middle of the screen. The problem isn't that the code isn't working, actually plots the function. But if the screen is of 320*480 then this function will be really tiny like in the image below. My question is: how can I change this algorithm to scale the function?. BTW what I'm really wanting to do is trace a route to later display an animated sprite, so actually scale this image doesnt gonna help me. I need change the algorithm in order to draw the same interval but in a larger space. Any tip helps, thanks! Current working result Desired result UPDATE: I will try explain more in detail what the problem is. Given this interval [-15...15] (-z(x) to z(x)) I need divide this points in a bigger interval [-320...320] (-x to x). For example, when you use some plotting software like this one. Although the div where is contain the function has 640 px of width, you dont see that the interval is from -320 to 320, you see that the interval is from -6 to 6. How can I achieve this?

    Read the article

  • Android Canvas Coordinate System

    - by Mitch
    I'm trying to find information on how to change the coordinate system for the canvas. I have some vector data I'd like to draw to a canvas using things like circles and lines, but the data's coordinate system doesn't match the canvas coordinate system. Is there a way to map the units I'm using to the screen's units? I'm drawing to an ImageView which isn't taking up the entire display. If I have to do my own calculations prior to each drawing call, how to I find the width and height of my ImageView? The getWidth() and getHeight() calls I tried seem to be returning the entire canvas size and not the size of the ImageView which isn't helpful. I see some matrix stuff, is that something that will work for me? I tried to use the "public void scale(float sx, float sy)", but that works more like a pixel level zoom rather than a vector scale function by expanding each pixel. This means if the dimensions are increased to fit the screen, the line thickness is also increased. Update: After some research I'm starting to think there's no way to change coordinate systems to something else. I'll need to map all my coordinates to the screen's pixel coordinates and do so by modifying each vector. The getWidth() and getHeight() seem to be working better for me now. I can say what was wrong, but I suspect I can't use these methods inside the constructor.

    Read the article

  • Javascript/Canvas/Images scaling problem in Firefox

    - by DocTiger
    I have a problem with the context2d's drawImage function. Whenever I scale an image, it gets a dark border of one pixel, which is kind of ugly. That does only happen in Firefox, not in Opera or Webkit. Is this an antialiasing problem? For hours I studied the examples and available documentation without getting rid of it... I couldn't yet try it on another computer so maybe just maybe it's an issue with the graphics hardware/drivers. I have reproduced this effect with this minimal snippet, assuming exp.jpg is sized 200x200 pixels. <html> <body> <canvas id="canvas" width="400" height="400"></canvas> </body> <script type="text/javascript" src="../../media/pinax/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" > context = $('#canvas')[0].getContext('2d'); img = new Image(); img.src = "exp.jpg"; //while (!img.complete); context.drawImage(img, 2,2,199,199); context.drawImage(img, 199,2,199,199); </script> </html>

    Read the article

  • Canvas - @font-face doesn't work on IE9+

    - by iMoses
    I've created a widget which allows the user to locate free-text over an image using a textarea. When saving the image a background canvas application reads the text and calculates its position, then it draws the text to the canvas over the image and saves a new image file. The font I use for this widget is league-gothic which I am importing using the @font-face method. This seems to work great and without any issues on all browsers except (of-course) for IE9 and IE10. When using internet explorer you can clearly see that the font was indeed loaded since the textarea uses the same font, but when trying to draw the text onto the canvas the font-family reverts to one of its fallback, in this case Arial. I've searched quite a bit and found nothing. Unlike most font issues I found that concern the canvas element, I am completely sure that the font has indeed loaded as I am viewing it before saving the result. Anything at all will help me at the moment. If you have any insight, experience with similar bugs or whatever, please share :) Thanks in advance. P.S. I can't expose a code example at the moment, but if it becomes a problem I'll do my best to provide one.

    Read the article

  • ScrollBars are not visible after changing positions of controls inside a Canvas

    - by akjoshi
    Hi, I created a custom canvas control inheriting from WPF Canvas. I am using it like this in main window - <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <RTD:RTDesignerCanvas Margin="5" Background="White" x:Name="canvas1" Focusable="True" AllowDrop="True"> </RTD:RTDesignerCanvas> </ScrollViewer> Everyhting works fine but when I try to set the position of controls inside it like this Canvas.SetTop(item, 200); scrollbars are not visible and control is hiddedn down somewhere. Intrestingly, if I add another control to it scroll bars are visible and I can scroll downwards to see the previous control. I tried to use base.InvalidateVisual(); base.UpdateLayout(); base.InvalidateArrange(); after changing items Top or Left but nothing happens; Am I missing something or this happens due to some bug?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >