graphics

C# graphics, paint, picturebox centering

陌路散爱 提交于 2019-12-24 07:18:14
问题 Ok, so this is the problem: in C# forms I've created a new private void: private void NewBtn(string Name, int x, int y) Which has a purpose of creating a picturebox that imitates behavior of a button (don't ask why, I simply enjoy complicating things) and can be called as many times as I want. Font btnFont = new Font("Tahoma", 16); PictureBox S = new PictureBox(); S.Location = new System.Drawing.Point(x, y); S.Paint += new PaintEventHandler((sender, e) => { e.Graphics.TextRenderingHint =

How to update components in different threads? .NET CF

怎甘沉沦 提交于 2019-12-24 07:16:23
问题 I´m programming a .NET Compact Framework application which shows maps on a PDA. I´ve created an ad hoc component that paints it´s own piece of the whole map, using several of this components the big picture is composed. I did it this way to avoid the latency of painting the whole map in a single step. What I would like to do now is to paint this pieces in their own thread, so the map appears to grow as a single entity and (also, and more important) to avoid freezing the rest of the user

Custom shader material taking forever to initialize?

[亡魂溺海] 提交于 2019-12-24 07:15:10
问题 I've been working on a raymarched project in three.js for a little over a year now and as the complexity has increased so has the initialization time. It can now take over 40 seconds to load the project in browser however once loaded runs at +60fps. I've tracked down the culprit function through performance tests and it seems to get hung up on the InitMaterial function within three's library. Does anyone have any idea as to what could be causing this hangup? Personally I believe it could be

Drawing exotic fonts in a java applet

风格不统一 提交于 2019-12-24 07:11:39
问题 I'd like to draw symbols contained in exotic fonts such as Wingdings, Webdings (they are called dingbats : http://en.wikipedia.org/wiki/Dingbat) in a java applet. When using Graphics.drawString() I end up with the typical 'square symbol' for each character in the drawn string. I could not find any answer by googling and I guess it's not something common. In the past I've done it with C# WPF, failed to do it with SVG and HTML. Is it possible in java? EDIT: Solved. There was a subtlety. Even

Draw lines on a picturebox using mouse clicks in C#

强颜欢笑 提交于 2019-12-24 07:07:50
问题 I'm trying to make a program that will draw lines over a picturebox using mouse clicks for the locations of where the line is to be drawn from and to. This is my current code: public partial class Form1 : Form { int Drawshape; private Point p1, p2; List<Point> p1List = new List<Point>(); List<Point> p2List = new List<Point>(); public Form1() { InitializeComponent(); pictureBox1.Image = new Bitmap(pictureBox1.Width, pictureBox1.Height); } private void button1_Click(object sender, EventArgs e)

Write text along a curve in Java

邮差的信 提交于 2019-12-24 06:44:40
问题 I was wondering if it were possible to fit text along the curve of a circle. It would be great if there were a way to accomplish this in Java2D. 回答1: Draw text along a curve with just awt and swing libraries. 来源: https://stackoverflow.com/questions/1094844/write-text-along-a-curve-in-java

How can I do a customer segmentation for month and see the customer number filtered?

隐身守侯 提交于 2019-12-24 06:29:21
问题 This is the output I would obtain https://i.stack.imgur.com/er8Du.png This is the sample pbix I have done https://mega.nz/#!lg9GASzR!D861nKR8cFGlm4eNyEa2BTep3ku_M5JjktvITAePmQ4 I would obtain the number of customers for each month with the label defined in the measure m-mark = IF([sumlast3months]=3;"Gold"; IF([sumlast3months]=2;"Silver"; IF([sumlast3months]=1;"Bronze"; ;BLANK()))) How can I find new customers in each month? I have thought to find them with a groupby for customerid with the

Viewing pipeline technical example

空扰寡人 提交于 2019-12-24 06:05:22
问题 What I'm trying to do in a sentence I'm trying to implement a viewing pipeline in Java by myself, so I'm using only Java AWT to draw 2D Polygons on canvas, without the help of OpenGL at all. Purpose of this post I'd like to test my results with you, since it's a difficult topic and I might have misunderstood some points. So let's describe my setup... I have made some raw data files for testing. Here's a file which represent a 3D Cube: 8 // number of vertices 0 0 0 // list of vertices indices.

Need images with lower resolution “stretched” to screen size

↘锁芯ラ 提交于 2019-12-24 06:03:04
问题 I am making a video game using C# WPF. What I am trying to implement now, is to add additional resolutions. My default monitor resolution is 1600x900. I am using the same size for game's window and grids. Now, I want to add more resolutions. I already found an easy way to change values in code, the problem is on another topic. That's how the game looks on 1600x900. Then, I am trying to set resolution 800x600. What I want to achieve, is to make images with resolution lower then the one set in

Need images with lower resolution “stretched” to screen size

空扰寡人 提交于 2019-12-24 06:02:05
问题 I am making a video game using C# WPF. What I am trying to implement now, is to add additional resolutions. My default monitor resolution is 1600x900. I am using the same size for game's window and grids. Now, I want to add more resolutions. I already found an easy way to change values in code, the problem is on another topic. That's how the game looks on 1600x900. Then, I am trying to set resolution 800x600. What I want to achieve, is to make images with resolution lower then the one set in