scale

COCOS2D-X: scale sprite

≡放荡痞女 提交于 2019-12-31 04:26:08
问题 I want to set scale for a sprite by height of original image. And then the width of that sprite will follow by original ratio of that image. How can i do that. Thank for all your help. 回答1: CCSprite has a member function virtual void setScale(float scale) Reference:setScale Just create a sprite, and call this function. CCSprite* bg = CCSprite::create("background.png"); this->addChild(bg,0); bg->setScale(2.0); bg sprite will be twice bigger than the origin one. 回答2: use setScale function of

AS3: Getting the scale of a Matrix object

十年热恋 提交于 2019-12-30 11:33:10
问题 Most often, questions are asked about how to scale a DisplayObject, and the answer is usually to use a Matrix. My question is, how to you GET the scale of a Matrix (scaleX and scaleY)? There's a Matrix.scale method to set the scaleX and scaleY, but it doesn't return a value, and no other properties exist to read it back. The reason I ask, I'm using object burried deep down into a Display list, and each may be transformed. So I use the child object's sprite.transform.concatenatedMatrix getter,

How do you tell Android not to scale images?

流过昼夜 提交于 2019-12-30 11:17:10
问题 I have some pictures in the /drawable folder, which to my understanding is intepreted as /drawable-mdpi. Now these images are scaled when being used (depending on the device). I don't want to add more pictures, because they don't exist. And I don't have the resources to create different res pictures. I just want the pictures to appear smaller on bigger devices. Is there a way of not scaling the images? I'd hate to have to hard-code all the picture sizes. This is the second question, as edits

How do you tell Android not to scale images?

这一生的挚爱 提交于 2019-12-30 11:17:10
问题 I have some pictures in the /drawable folder, which to my understanding is intepreted as /drawable-mdpi. Now these images are scaled when being used (depending on the device). I don't want to add more pictures, because they don't exist. And I don't have the resources to create different res pictures. I just want the pictures to appear smaller on bigger devices. Is there a way of not scaling the images? I'd hate to have to hard-code all the picture sizes. This is the second question, as edits

How to scale and position watermark to scale?

坚强是说给别人听的谎言 提交于 2019-12-30 05:30:08
问题 I'm scaling a video and applying a watermark like so: ffmpeg -ss 0:0:0.000 -i video.mp4 -y -an -t 0:0:10.000 -vf \"[in]scale=400:316[middle]\" -b:v 2000k -r 20 -vf 'movie=watermark.png,pad=400:316:0:0:0x00000000 [watermark];[middle] [watermark]overlay=0:0[out]' out.flv However, the applied watermark seems to be scaled to the original video size rather than the smaller scaled video size. This command line worked on ffmpeg version 0.8.6.git and now behaves differently after an upgrade to

WPF binding Width to Parent.Width*0.3

醉酒当歌 提交于 2019-12-30 03:19:46
问题 I want to bind a control's Width to the parent's Width, but to a certain scale. Is there a way to do something like this: <Rectangle Name="rectangle1" Width="{Binding ActualWidth*0.3, ElementName=thumbnailCanvas, UpdateSourceTrigger=PropertyChanged}" Height="{Binding ActualHeight, ElementName=thumbnailCanvas, UpdateSourceTrigger=PropertyChanged}"/> 回答1: Sure, but you will need to use a converter. Something like this one: using System; using System.Globalization; using System.Windows.Data;

Android : how to ScaleY to based on other Object's Position?

和自甴很熟 提交于 2019-12-29 09:33:02
问题 this is android based question. Here I have 2 Objects : Springs, 1.Box (objectMass) I then tried to move the box to certain position below using this code: objMass.setTranslationY((float) y_newPost); But then my question is related to the Springs object. How do I ensure that the bottom of the springs follow to the position of the Box after its movement? Perhaps scaling is the answer, but to be honest, should I calculate the height of the Springs first, then doing the scaling-Y of the Springs

Android : how to ScaleY to based on other Object's Position?

[亡魂溺海] 提交于 2019-12-29 09:32:10
问题 this is android based question. Here I have 2 Objects : Springs, 1.Box (objectMass) I then tried to move the box to certain position below using this code: objMass.setTranslationY((float) y_newPost); But then my question is related to the Springs object. How do I ensure that the bottom of the springs follow to the position of the Box after its movement? Perhaps scaling is the answer, but to be honest, should I calculate the height of the Springs first, then doing the scaling-Y of the Springs

using two scale colour gradients on one ggplot

大兔子大兔子 提交于 2019-12-28 03:06:09
问题 I would like to combine a colour scale gradient for the points on a scatter plot together with a colour scale gradient for some text that goes on the plot. I can do them separately as shown in my example below, but i can't seem to put them together...is there a way of doing this? Here is my example code of the two types of plots (p and p1) that I want to combine l <- data.frame(prev=rnorm(1266), aft=rnorm(1266), day=as.factor(wday(sample(c(2:6),1266,replace=TRUE),abbr=TRUE, label=TRUE)),

How do I scale a streaming bitmap in-place without reading the whole image first?

ぃ、小莉子 提交于 2019-12-28 02:39:13
问题 I have an Android application that is very image intensive. I'm currently using Bitmap.createScaledBitmap() to scale the image to a desired size. However, this method requires that I already have the original bitmap in memory, which can be quite sizable. How can I scale a bitmap that I'm downloading without first writing the entire thing out to local memory or file system? 回答1: This method will read the header information from the image to determine its size, then read the image and scale it