graphics

How to make a rectangle move when PictureBox is resized

巧了我就是萌 提交于 2020-01-06 05:10:08
问题 I have a PictureBox with a picture as a background of an application, having all the Anchors set, so it can resize with the form. On this PictureBox, I am creating many other things, for now only rectangles. I am creating them on some X and Y coordinates, that is fine. Adding a picture to show what I am trying to do. Created rectangle is actually the little light blue square. But, when i resize the form, for example I maximize it, the rectangle stays at the same coordinates, which of course

Scale Label text in line with Label size

眉间皱痕 提交于 2020-01-06 04:53:08
问题 Looking for a way to resize a Labels text in line with the change in size of the Label . (ie. should a label increase in size by 50% , then the text should also increase in size by approx 50% ). There is plenty of articles around which adjust the text to fit fully within the size of a Label , which isn't suitable for what I want. I already have a working version of this. Somehow I need to be able to reference the previous size of a Label once the resize is complete in order to determine the

Reducing colors in a PNG image is making the file size bigger

时光怂恿深爱的人放手 提交于 2020-01-06 02:37:18
问题 I am using ImageMagick to programmatically reduce the size of a PNG image by reducing the colors in the image. I get the images unique-colors and divide this by 2. Then I assign this value to the -colors option as follows: variable = unique-colors / 2 convert image.png -colors variable -depth 8 I thought this would substantially reduce the size of the image but instead it increases the images size on disk. Can anyone shed any light on this. Thanks. EDIT: Turns out the problem was dithering.

Change the color of a subset of group labels in a boxplot in R

做~自己de王妃 提交于 2020-01-06 01:54:12
问题 How do I change the color of only a subset of labels in a simple boxplot? For example, on the X-axis I have groups "3", "4", and "5", and I only want to change the color of the "4" group label. It's easy to change the color of the boxplot itself with the col="red", or even the border of the boxplot with border="red", but I cannot find any reference to changing JUST the label. Example: boxplot(mtcars$hp~mtcars$gear) Thanks! 回答1: You could also try mtext : b <- boxplot(count ~ spray, data =

Change the color of a subset of group labels in a boxplot in R

末鹿安然 提交于 2020-01-06 01:53:05
问题 How do I change the color of only a subset of labels in a simple boxplot? For example, on the X-axis I have groups "3", "4", and "5", and I only want to change the color of the "4" group label. It's easy to change the color of the boxplot itself with the col="red", or even the border of the boxplot with border="red", but I cannot find any reference to changing JUST the label. Example: boxplot(mtcars$hp~mtcars$gear) Thanks! 回答1: You could also try mtext : b <- boxplot(count ~ spray, data =

How can QPainter performance be improved?

我与影子孤独终老i 提交于 2020-01-05 12:58:35
问题 I have a large display (about 1000x2000 pixels) and I'm doing the following to draw images to the screen: QImage *pImage = GetImage(); // from wherever QPainter painter(this); painter.drawImage((0,0), *pImage); // this line takes over 100ms to complete. The larger the screen is that I'm drawing to, the longer this paint takes. I guess the pImage is being memcpy'd and that's the difference. How can I reduce this overhead? I'm not trying to scale or anything here. Thanks. 回答1: You're painting a

How to change the mouse pointer to an Image when clicked on it in c#

时光毁灭记忆、已成空白 提交于 2020-01-05 09:23:36
问题 How can i change the mouse pointer to an image when clicked on the image in c#? 回答1: The question is vague/unclear but perhaps you want to change the system cursor (not just your application)? Here is a link to the pinvoke info for SetSystemCursor. Be warned this is considered bad form. 回答2: This MSDN article explains how you would do it with WPF. Just change their drop-down to a OnClick for the image you're interested in. You could likely also hook in to an OnClick event in WinForms too, but

How to change the mouse pointer to an Image when clicked on it in c#

寵の児 提交于 2020-01-05 09:23:07
问题 How can i change the mouse pointer to an image when clicked on the image in c#? 回答1: The question is vague/unclear but perhaps you want to change the system cursor (not just your application)? Here is a link to the pinvoke info for SetSystemCursor. Be warned this is considered bad form. 回答2: This MSDN article explains how you would do it with WPF. Just change their drop-down to a OnClick for the image you're interested in. You could likely also hook in to an OnClick event in WinForms too, but

steps in feature-based registration

帅比萌擦擦* 提交于 2020-01-05 07:44:24
问题 What are the steps in feature-based registration? If I have a transformed image matching to a stack of images (of which only one is the best match), what are the steps in registration? Once I find matches and use them to estimate a transform, what's usually the next step? 回答1: Find points/areas which are invariant to different kind of transformations like: translation, rotation, scale.. because this points are invariant to those transformation we can find them in the different images that we

R plot options in rdd::DCdensity

核能气质少年 提交于 2020-01-05 07:37:24
问题 I'm using the DCdensity function in the rdd package, which produces a plot of the density of a run variable in a regression discontinuity design, assuming the argument plot = TRUE . The help page says "The user may wrap this function in additional graphical options to modify the plot." I want to produce the default plot, but with larger axis title/tick font size, but I can't figure out how to do it. DCdensity doesn't accept additional arguments, and when I wrap the function call in plot() as