FAQ Database Discussion Community


Apply scale and rotation to a specific point - Javascript

javascript,math,rotation,transform,scale
We've been having some trouble with scaling AND rotating a point in relation to another div. Essentially we have 2 layers, one with and image(svg) and another layer with icons that are placed on the image. We've been able to rotate the icons based on the image's rotation (and position),...

Swift: Edit image taken from camera to fill a UIImageView

ios,image,swift,uiimageview,scale
I have used a UIImageView that takes its image from the default camera app using UIPicker. But the image I am getting is too small to fit into the image view and if I use: imageView.contentMode = UIViewContentMode.ScaleToFill While this indeed scales to fit the image view the picture looks...

How to know the scale for a bitmap in Delphi XE8?

delphi,bitmap,scale,firemonkey,delphi-xe8
I have an image component for drawing an autograph. At the moment you have to set a scale property mannually in order to let it draw correctly, because each device has an other screen density. Is there a way to calculate the scale or not to have to use the...

How to scale an element when it loads using only CSS?

html,css3,transform,scale
I'm loading an element that has the initial css values of : .popOver { height: 100%; width: 100%; position: fixed; background-color: #d9dfe5; transition: all 2s ease-in-out; transform: scale(0,0); } I need to change to scale(1, 1) when the element loads in the page and see the transition. Anyone can help?...

Resize image without loss of information

java,image,resize,scale,bufferedimage
I was trying to do really the same functionality of resizing images like in MS Word. I want to resize BufferedImage but I’m losing some information during process of resizing. I tried to implement two approaches, but both produced same result. Before any resizing: Picture after few resize actions in...

Scale div into div like background image

javascript,html,css,image,scale
I'm working on a web app and now facing a rather tricky task. I have an image that I have to add overlay for. Let's say I have an image of a car. I need to add values, like outside and inside temperature, on top of the car image. It...

High resolution image with Mapnik

scale,retina,mapnik,high-resolution
I use Mapnik 2.2.0 to render a map from my Java library using the Mapnik JNI. This is working fine with no issues. I am now trying to make the map available in high resolution. I changed the image size in my code from 256x256 to 512x512. This caused Mapnik...

Rescale an image for printing

java,printing,scale,rescale
I need to rescale an image for printing, but I only have two different results: The image is bigger than the page. The image is cutted and I see only a small percent of the image on the page. I put two images to see it better. The first one...

Similiar Windows scale on HTML

html,scale
I am trying to obtain a scale item similar to the one from Windows . However everything I search on the web only refers to scaling divs, images, etc. What I want is this scale and everytime I move it the value changes. Does anyone have any idea how can...

CSS3: Transition hover and animation rotation bug

css3,animation,rotation,hover,scale
I am trying to make an image always rotating, and on the hover a scale. First I tried with Firefox Developer Edition, works nice but once the mouse is out, the image came back to the original position and suddenly returned to the position of rotation. In chrome doesn't work,...

How do I scale the graphics of a game?

c#,matrix,xna,window,scale
I'm making a game in C# and XNA 4.0. It's pretty much finished, but now I want to add settings so that players can change the window size if they want to. The current setup goes like this: void Initialize() { //The window size is initally 800x480 graphics.PreferredBackBufferWidth = 800;...

Android : Zoom by center pinch

android,scale,android-scrollview,horizontalscrollview
So, I have ScrollView, HorizantalScrollView and BoardView for TicTacToe game. When user zooms, while i redraw scale into categories of cells through ScalegestureDetector zoom pinch is allocated on top, left of the screen, not at the centre of pinches, how can I allocate it to the center? here is my...

ios: scaling font horizontally without rasterising

ios,fonts,scale
Android provides a property textScaleX, that allows to scale text horizontally while retaining font height. I use it quite extensively for Android apps (especially for languages which are not as compact as English) and wish to find something similar in ios. Obviously, I can draw a text to a graphic...

Scale divs height pure CSS

html,css,css3,scale,ratio
I need to scale the height of divs. How it should work The divs should scale, keep current aspect ratio The width should be 100px always The height should scale in propotion to the 100px width I added some example width and height in the code Add more HTML +...

Progress View Flip and Scale

ios,objective-c,rotation,scale,progress
I am trying to flip a UIProgressView 180 in Xcode and I am trying to scale the progress view at the same time. The scaling works great until I add the flip and then the scaling does not work anymore. Any suggestions? Thanks! [self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeScale(1.0, 10.0)]; [self.secondsPorgressBarTicker setTransform:CGAffineTransformMakeRotation(-M_PI)]; ...

Java - Transposing Music Notes by Scale Indices

java,algorithm,scale,music,theory
I have been trying to create an algorithm for a long while now that is supposed to transpose musical notes up or down according to their given scale and transpose factor. Current Algorithm: public Note getNoteByScale(Scale scale, int transposeFactor) { int newPitch = scale.getScaleIndex(this.pitch) + transposeFactor; int newOctave = this.octave;...

How to scale an iFrame inside of iOS UIWebView

javascript,ios,css,uiwebview,scale
The Problem: I've been seeing problems with the native iOS UIWebView with regard to CSS3 transform:scale3D(scalar, scalar, 1) We have an <iframe> which contains pixel-perfect art, consisting of many elements (text, rectangles, videos, etc), and my task is to scale the <iframe> where it fits fullscreen, not just the designed...

scale texture opengl 2

opengl,textures,scale
I have a rectangle in opengl 2 and I'm using a texture for it. It Works, but the texture is repeated over the rectangle, and what I want is to adapt to the size of the rectangle. I have read in this tutorial about the different parameters you can set...

Surface view and scaling

android,height,scale,surfaceview,weight
Before all, I apologies for my English. I'm a newbie in programming of Android App and I recently discovered the Canvas and Bitmap, so I decided to make a "Game" that can only use landscape. I discovered too the SurfaceView and how implement a background on my SurfaceView, but the...

D3.js chart brush and Crossfilter.js scales out of sync

javascript,d3.js,scale,crossfilter,brush
I am trying to highlight selections in my D3 bar chart using the brush extent. JSFiddle http://jsfiddle.net/Nyquist212/yys2mqkx/ I'm using crossfilter to reduceCount() my data so I can plot score distribution. But this seems to be screwing with my x-scale. The effect is most noticeable when you drag the entire brush...

Set button's background to image, scaling as needed

java,android,button,scale
I have a simple layout: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/button5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/button_background" android:text="Button" android:gravity="center" android:textColor="#FFFFFF" /> <Button android:id="@+id/button6" android:layout_width="wrap_content"...

How to change focus after scaling view?

android,focus,scale,relativelayout
To scale view I use next code: relativeLayout.setScaleX(scale); relativeLayout.setScaleY(scale); But after it I have the next:1 So it is offset. I need to make it not offset. I need to add some thing like pivot point for canvas but it must be for view....

Does CouchDB limit the number of views per design doc?

couchdb,scale
I'd like to build an application that creates a new _view for each user of the application. I'm wondering about scale. A a million users (should we be so fortunate) does one long list of views within a design doc still function with some performance? Update: What I'm trying to...

Maya Python… workaround for arbitrary precision when coding with maya.cmds

python,decimal,scale,maya,arbitrary-precision
Maya commands library seems to dislike working with the built in decimal module in python. I am trying to scale an object by an arbitrarily large float for precision. As far as understanding that you can't scale by a decimal 'object' is clear. ive been trouble shooting the math and...

What technologies should I use to create a real time One to One chat?

chat,real-time,scale
I'm a PHP developer with a lack of experience on other sever side langages. I’d like you to give me leads, advice, keywords or whatever that could help me refine my research better. What I want to do is basically to create a one to one mobile app chat that...

Rotate text in SVG

xml,svg,rotation,scale,scaletransform
I got a chart with svg which looks like Now I want to rotate the text like My SVG root is the following <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.1" baseProfile="full" viewbox="-75 0 1075 800" transform="translate(0, 750) scale(1, -1)" width="1000" height="800"> </svg> If I try to rotate the text with <text x="-70"...

CSS :hover transform scale command rotate object instead

css,hover,transform,scale
.arrow { display: inline-block; height: 8px; width: 8px; margin-top: 20px; border-top: solid black 2.5px; border-left: solid black 2.5px; -ms-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -webkit-transition: transform 1s; -moz-transition: transform 1s; transition: transform 1s; cursor: pointer; } .arrow::before { content: ""; display: inline-block; width: 18px; margin-left: -3px; margin-bottom: 7px; border-top:...

ggplot: assign manual break points to date scale

r,date,datetime,ggplot2,scale
I have some time series data and I would like to customize the x-axis (dates) to show the date labels where I obtain measurements, as opposed to having regular breaks per week/month/year. Sample data: dates <- as.Date("2011/01/01") + sample(0:365, 5, replace=F) number <- sample(1:100, 5) df <- data.frame( dates =...

Java Graphics2D scale doubling

java,scale,graphics2d
I'm having trouble scaling objects with Graphics2D in Java. In my paintComponent I create two graphics2D objects for easier management. I then try to scale them. The problem is that the output is scaled x4 (the scale commands affect each other). Otherwise everything renders as it should. How is this...

CSS: How to scale an image from the center instead of top-left

css,scale,center,transition
So my problem is that I have an image and I set its CSS to have a max-width: 100% which scales it at lower resolutions ( as will be seen in the fiddle below ). What I want is for the transition to take effect from the center of the...

ggplot2 change colorbar label

r,ggplot2,scale,colorbar
I want to plot a matrix. In order to clearly see the low values, code is like below. p <- ggplot(data = melt(x)) p + geom_tile(aes(x=Var2,y=Var1,fill = value)) Now in order to see details, I prefer use square root scale. But if I change fill = value to fill =...

android imageView scale

android,imageview,scale
I have an ImageView which is populated from database (the image comes from database). in the database i have images both portrait and landscape!! how can i adjust the imageView to scale it self according to the image width and height. I have tried many ways but no result! any...

Why i cannot show my byte[] image after converting it from bitmap?

java,android,bitmap,bytearray,scale
I'm trying to write a method that accepts an image(Bitmap) and returns a byte[] array. finally, I try to write this byte[] array to a folder so I can see the difference, but my byte[] arraycan not displayed, and in addition, it is not scaled down! This is my method:...

ThreeJS – smooth scaling object while mouseover

object,three.js,scale,onmouseover
another ThreeJS question: How can I make a hovered (intersected) object scale smooth to a defined size? My current code is INTERSECTED.scale.x *= 1.5; INTERSECTED.scale.y *= 1.5; but this only works like on/off. Edit: My Solution (with tweenJS) While mouseOver I scale up the element to 200% : function scaleUp(){...

SCNNode material scale

scale,scenekit,material,scnnode
I have an SCNNode that has its geometry populated from a collada file (.dae) and displays correctly on screen. I can apply materials to the geometry easily enough, however I'd like to change the scale of the material. I currently populate it with nodeArray[0].geometry?.firstMaterial!.diffuse.contents="wood.png" but the scale of the material...

Scale (CSS transform) iframe based on window height

jquery,css,iframe,scale
A am trying to modify an existing working JS (https://github.com/mattnish/rad) for scaling by width to scale by height, and instead of doing a logical transform, the div continues to grow as the window size is changed, so the source continues to scale to fit, never matching the window. Width-wise scaling...

how to change the scale of view

ios,swift,view,scale
I am trying to make sidebar menu like in app Euro Sport! When the menu slides from left , the sourceviewcontroller slide to left and becomes smaller. var percentWidthOfContainer = containerView.frame.width * 0.2 // this is 20 percent of width var widthOfMenu = containerView.frame.width - percentWidthOfContainer bottomView.transform = self.offStage(widthOfMenu) bottomView.frame.origin.y...

Scale value in label

python,user-interface,tkinter,scale
I put in my frame scale, but I'm not sure how I can show the value of this scale in my label. I need to update it every time the scale moves. How can I do that? self.options_settings.framepripojeni6 = Frame(self.options_settings.tab1) self.options_settings.framepripojeni6.pack(side=tkinter.TOP, expand=0, fill=tkinter.BOTH, padx=2, pady=4) self.options_settings.scale = Scale(self.options_settings.framepripojeni6,from_=1, to=60, length=350)...

How to scale concurrent ETL tasks up to an arbitrary number in SSIS?

concurrency,ssis,scale,etl
Problem (See Context below) How can I scale individual tasks (e.g. downloading and parsing) to an arbitrary number of concurrent executions (e.g. 500) in SSIS? Setup Description Our setup is that we have a list of feed urls we want to visit, get all items and insert them into the...

D3 zoom is not properly reseting zoom state and translated location

javascript,jquery,d3.js,zoom,scale
Well I already got it working, but somehow when tested now it does not work anymore. So in my project I have a map that is zoom- and dragable. When zoomed in or dragged you can always click a Reset button to reset the whole presention. That works great. So...

Firefox mobile: Links getting activated by touching elsewhere

firefox,mobile,hyperlink,scale,viewport
I've got a strange probleme here. If I have this line in the HEAD part <meta name="viewport" content="width=1200,initial-scale=2,minimum-scale=2"> touching the lines which are not links in the following example causes one of the links to get activated: <ul> <li><a href="http://www.example.com">example</a></li> <li><a href="http://www.test.com">test</a></li> <li>Text in between</li> <li>Even more text in between</li>...

CSS: Problems when using object-fit and transform together on webkit

css,css3,webkit,transform,scale
I'm trying to use both the css property object-fit: cover on an img element to have my image filling its containing div and transform: scale(xx) to have the image zooming out on hover. Here is a sample fiddle: https://jsfiddle.net/96kbuncq/ Edit: sample with real images: https://jsfiddle.net/96kbuncq/3/ HTML: <div> <div class="category"> <img...

Scale div like an image

javascript,jquery,html,css,scale
I am trying to scale content within a div based on it's width. As an example, I have a div: <div id="container"></div> I have styling such as: #container { margin: 0px auto; width: 810px; height: 800px; border: 1px solid #000; } This presents me with a div 810px wide and...

Scaling a view and all its contents

ios,scale,layoutsubviews
I'm wondering if there's a way to scale a UIView and all it's subviews. When I say scaling, I'm not just talking about the frames, I wan't to scale everything so the fonts too. At the moment I'm doing it manually : -(void)setScale:(float)scale { // Apply scale on all subviews...

Breeze - Saving decimal type has wrong scale?

entity-framework,decimal,breeze,scale
i'm using the latest Breezejs (1.5.3) for data operations in sql server with Entity Framework. The save operation is done successfully. the savemap has the decimal value with full scale but after update the field in DB has wrong scale (number of decimal points). e.g the savemap has the value...

How to scale image block using only css?

html,css,html5,css3,scale
Here is 3 inline blocks. The first one is scalable and the right two blocks has fixed width. In case we resize browser right to block should be visible anyway. #blockID should fit the page, at the same time image should be scalable if we resized window. I'm trying to...

Automatic button scaling based on window size C#/XAML

c#,xaml,transform,scale,resolution
i'm fairly new at this so i apologize in advance if i say anything stupid. I am making a UI in WPF that consists of 8 buttons to open various programs set on my computer. Currently i am trying to get the buttons in the UI to scale based on...

Get device image scale (e.g. @1x, @2x and @3x)

ios,image,swift,scale,retina-display
I have an app that uses a service to get some icons. With this service I can get any image of any size, so I've planned to get the 3 images (@1x, @2x and @3x) and store them on the BBDD, and then get the scale to use one of...

Actionbar background color changes on scale

android,colors,android-actionbar,scale
I used this code to change actionbar color that is used with appcompat lib: actionBar.setBackgroundDrawable(new ColorDrawable(R.color.teleblue)); but in use color changes and in different screen sizes color is different. I don't want to clean the original question with tricky ways. how can I fix it? thank you...

How can get the div background image to scale to the page size?

html,css,image,scale
I am trying to make the background image of the div header scale to the size of the page. Here is the current css: .Header { background-image: url(Images/logo.png); height: 160px; width: 960px; margin-left: auto; margin-right: auto; margin-top: 20px; } ...

Why am I getting a weird results from my scaleImage method?

java,android,scale,image-scaling
I'm trying to scale an image in relation to the width/height. Here is my method: private byte[] scaleImage(Bitmap image) { byte[] image = new byte[]{}; int width= image.getWidth(); int height = image.getHeight(); int wh = width / height ; int hw = height / width ; int newHeight, newWidth; if...

gimp: resize and “unsharp mask” via script

shell,scale,gimp
I need to do the same operations for more than 60 files: scale image unsharpen mask Is it possible to execute this from a script possibly passing the scale value ? I'm on Ubuntu if this could influence the answer. edit: What I need to do is to resize some...

d3 scale.linear() : pass data as parameter

javascript,d3.js,scale,linear
I'm building multiple bar charts with d3, and would like to apply the same scale based on the input data, which consists of different JSON arrays, for each chart. To find the maximum value of each array, I wrote this function: var maxInArray = function (dataArray,propertyName) { var result =...

Scaling HTML5 Canvas Image

javascript,html5,oop,canvas,scale
Building a web page on which I am trying to set an image as the background of the main canvas. The actual image is 1600x805 and I am trying to code the application so that it will scale the image either up or down, according to the dimensions of the...

Openlayers 3 - What does resolution represent as a style function parameter?

scale,resolution,openlayers-3
I am trying to use resolution passed into the StyleFunction to work out the size of my image Icons. Using tests, at a zoom where the scale line is 100m the resolution reported to the styling function is 2.3886. I've take screenshots of the scale line and measured its length...

Android avoid image scalling in Imageview for Image Mapping like Html

android,imageview,android-imageview,scale,imagemap
Hi Am trying to implement image mapping as like html in android. For that i referred this project. Its work good when i access the image from drawable-nodpi folder. But when i access from other drawable folder the image get scaled as per the android concepts. Here i used drawable...

Responsive rescale of background images CSS

css,image,background,responsive-design,scale
I want to build a really small responsive website with an image hover effect which I create with a css background image switch. My problem is that everything I try to rescale the image it doesn't work. "Background-size: contain" creates a big white block under the image css #m2 {...