scaling

Translating/transforming? list of points from its center with an offset/distance

心已入冬 提交于 2019-12-02 12:23:39
Well, I'm currently trying to move a list of points using its center as reference with a desired offset. But I'm having problems. I have implemented the current function: public static IEnumerable<Point> Translate(this IEnumerable<Vector2> points, float offset, Vector2 pivot) { foreach (Vector2 v in points) { float magnitude = (v - pivot).magnitude; Vector2 n = (v - pivot).normalized; Vector2 _v = n * (magnitude + offset) + pivot; yield return new Point(_v); } } Note: Point class is an own implementation very similar to System.Drawing.Point . I calculate the normal (the direction between the

How to scale and add correct a logo in ffmpeg command?

99封情书 提交于 2019-12-02 07:48:14
I am trying to apply a watermark and also to scale it to the current video size via ffmpeg command: Here is my inital comand that works without watermark ffmpeg -v 0 -vcodec h264_qsv -i 'udp://@some.ip:1234?fifo_size=1000000&overrun_nonfatal=1&buffer_size=1000000' -vf scale=iw:ih -profile baseline -acodec aac -ac 1 -ar 44100 -ab 64k -deinterlace -vcodec h264_qsv -bufsize 4000k -maxrate 3500k -preset veryfast -vb 2000k -f flv rtmp://127.0.0.1/app/720 Now I tried to add the picture as a watermark. There was a conflict while using with -vf scale=-1:ih*.5 , in order to eliminate the problem I used

HighCharts: Logarithmic Scale for Horizontal Bar Charts

╄→尐↘猪︶ㄣ 提交于 2019-12-02 06:45:44
问题 I am working with HighCharts to produce a bar chart. My values can range from as minimal as 0 to as high as 100k (example). Therefore, one bar of the graph can be very small and the other can be very long. HighCharts has introduced the feature of "Logarithmic Scaling". The example of which can be seen HERE My js code is written in this jsfiddle file. I want to display my horizontal axis (x-Axis) logarithmically. I have inserted the key type as shown in the example but the script goes into an

Libgdx camera/scaling issue

穿精又带淫゛_ 提交于 2019-12-02 06:07:14
This is just a really quick post wondering what i have done wrong? I want the background to be filled on the whole screen with whatever screen sizes i have but this does not make it work. Here is all the code: // Variables Jump game; OrthographicCamera cam; SpriteBatch sb; // Variables public SplashScreen(Jump game) { this.game = game; cam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); cam.translate(cam.viewportWidth / 2, cam.viewportHeight / 2); sb = new SpriteBatch(); } public void show() { } public void render(float delta) { Gdx.gl20.glClearColor(0.2F, 0.6F, 1F

Scaling Picturebox does not change image at all

丶灬走出姿态 提交于 2019-12-02 05:34:05
I'm using a picturebox to create a visual of an instance of my truss class. I'm creating the visual by drawing directly onto the picture box in the paint event. The method looks like this private void pictureBox1_Paint(object sender, PaintEventArgs e) { if (isDraw) { //Preparing to draw Graphics g = e.Graphics; g.SmoothingMode = SmoothingMode.AntiAlias; g.InterpolationMode = InterpolationMode.Bicubic; RunEntry entry = this.passedHistory.SelectedItem as RunEntry; AnsFile objToDraw = entry.FileRead; Pen pen = new Pen(Color.Black); //Getting size of bitmap int maxWidth = 0, maxHeight = 0; foreach

Scaling up an image using nearest-neighbor

旧时模样 提交于 2019-12-02 04:52:53
I have been trying to make my program scale up an image. I had some problem to allocate new space for my scaled image, but I think it is fixed. The problem I am having is that the program crashes when I am trying to send back my image from my temporary memory holder. The loaded image is placed in my struct Image . The pixels are placed in img->pixels , the height in img->height and the width in img->width . But I have no idea why the program crashes when I transfer the pixels from my tmp2 struct to my img struct while it does not crash when I do the opposite. Here is the code: void makeBigger

JavaFX - How to make VBox children grow with VBox parent

寵の児 提交于 2019-12-02 03:27:09
问题 VBox classBox = new VBox(); className = new Text("defaultClass"); classBox.setAlignment(Pos.CENTER); classBox.getChildren().add(className); classBox.getStyleClass().add(VM_BOXES); variablesBox = new VBox(); variablesBox.getStyleClass().add(VM_BOXES); methodsBox = new VBox(); methodsBox.getStyleClass().add(VM_BOXES); this.getChildren().add(classBox); this.getChildren().add(variablesBox); this.getChildren().add(methodsBox); this.getStyleClass().add(VM_BOXES); Hi, I have a class that extends

HighCharts: Logarithmic Scale for Horizontal Bar Charts

元气小坏坏 提交于 2019-12-02 01:48:28
I am working with HighCharts to produce a bar chart. My values can range from as minimal as 0 to as high as 100k (example). Therefore, one bar of the graph can be very small and the other can be very long. HighCharts has introduced the feature of "Logarithmic Scaling". The example of which can be seen HERE My js code is written in this jsfiddle file. I want to display my horizontal axis (x-Axis) logarithmically. I have inserted the key type as shown in the example but the script goes into an infinite loop which has to be stopped. What is the flaw in the execution or is logarithmic scaling for

Scalable painting of a Qt application

徘徊边缘 提交于 2019-12-01 23:50:08
问题 I'm writing a simulation of an embedded device's screen (which contains custom widgets on top of a main QWidget), and while the native size of the screen is 800x600, I want to be able to scale it up and down by dragging the window's corner. Without diddling with grid layouts and stretchers (which won't scale the fonts up/down), how do I accomplish this sort-of zoom? I think part of the solution might be to create a QTransform and somehow inject that into the QWidget for the entire application

Which instances are stopped when I scale my Azure role down?

早过忘川 提交于 2019-12-01 22:48:54
Suppose I have an Azure role with three instances running. I ask Azure to change the role count to two either by Management Portal or via Management API. How will Azure decide which role to take down? As British Developer mentioned, the Windows Azure Fabric Controller decides which instances to shut down. You cannot control this process. I don't think it is always the last number, because I am not sure whether the fabric controller does not rename the instances after shutting down. So even if it shuts down IN_1, at the end of the process we will still have IN_0 and IN_1, instated of IN_0 and