paint

Operating Ms Paint using excel-VBA

邮差的信 提交于 2019-12-24 09:38:02
问题 I've written a code to copy the charts from a worksheet (in my excel workbook) to Ms-Paint and then saving the results. Sub paintCharts() ThisWorkbook.Sheets("DesiredData").Activate With ActiveSheet.ChartObjects.ShapeRange.Group .CopyPicture .Ungroup End With Dim path_Paint As String Dim paintID As Variant path_Paint = "C:\Windows\System32\mspaint.exe" paintID = Shell(path_Paint, vbNormalFocus) Call AppActivate(paintID) Call SendKeys("^V") End Sub I am getting an error at the Call AppActivate

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 =

“InvalidOperationException: Object is currently in use elsewhere” during innocuous onpaint?

若如初见. 提交于 2019-12-24 07:17:13
问题 For some reason we are getting "InvalidOperationException: Object is currently in use elsewhere." during our custom OnPaint, below (that's actually almost a line for line copy of the code... there's that little there). We have logging in the exception handler below to detect if we're somehow calling OnPaint from a non-UI thread... and that isn't getting tripped, but we are getting that error logged (see stack trace below). On machines where we're getting these errors, we're also seeing the

How Do I Use a QStyledItemDelegate to Paint Only the Background, Without Covering the Text?

时间秒杀一切 提交于 2019-12-24 02:52:16
问题 How should I change just the background color of my tree item using a delegate? I haven't been able to figure out how to do this without painting on top of the text. In other words, when I use the code below, the color is drawn on top of the text. The text is under the background... def paint(self, painter, option, index): MyDelegate.paint(self, painter, option, index) painter.save() # set background color painter.setPen(QPen(Qt.NoPen)) if self.item.is_set and option.state & QStyle.State

Fill pattern in Image in Android

牧云@^-^@ 提交于 2019-12-23 10:18:16
问题 Two images are given blow i call first image as frame image and second image as frame image.Here fst is my Linear Layout and i set the frame-image as background image of it. Now i want to fill the pattern image in my frame image's white area. Outer area of the frame image is transparent and inner area is white. How can i fill pattern image in my frame-Image. I tryied this code. private void patternFill(Bitmap tempBitmapColor) { Bitmap bmp = BitmapFactory.decodeResource(getResources(), R

Java Paint component into bitmap

北城以北 提交于 2019-12-23 10:09:58
问题 I need to draw the content of a component and all its subcomponents in a bitmap. The following code works perfectly if i want to draw the entire component : public void printComponent(Component c, String format, String filename) throws IOException { // Create a renderable image with the same width and height as the component BufferedImage image = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB); // Render the component and all its sub components c.paintAll(image

Trying to create an Eraser Paint for canvas

自古美人都是妖i 提交于 2019-12-23 07:48:51
问题 I am creating a drawing app that utilizes the DrawingSurfaceView class below. In that class i have a Paint Called eraserPaint that the user can toggle on and off.. When on that paint is suppose to eraser what ever is in its path. but instead its just drawing a black line.. When i save out the canvas as a transparent png the eraser is correct but on the screen it shows black.. Screenshot from phone of EraserPaint used to write "Erik" on blob Saved out PNG from canvas eraserPaint looks like

How to add image to the canvas so that I can draw line on it

无人久伴 提交于 2019-12-23 07:02:15
问题 I have the code for custom view but unable understand how to set image so that I can draw on the image.I have tried solutions given on stackoverflow, but image is not getting added can anyone help me with this, Kindly check the code given below: Or how do I set Image as background for my customview.I am getting only the white background. public class CustomView extends View { private static final String LOG_CAT = CustomView.class.getSimpleName(); //drawing path private Path drawPath; /

How to add image to the canvas so that I can draw line on it

半城伤御伤魂 提交于 2019-12-23 07:02:01
问题 I have the code for custom view but unable understand how to set image so that I can draw on the image.I have tried solutions given on stackoverflow, but image is not getting added can anyone help me with this, Kindly check the code given below: Or how do I set Image as background for my customview.I am getting only the white background. public class CustomView extends View { private static final String LOG_CAT = CustomView.class.getSimpleName(); //drawing path private Path drawPath; /

Paint an image without removing it on html5 canvas

你。 提交于 2019-12-23 04:41:46
问题 I have a black and white image and i would like to paint it with the color i picked without removing the image. When i start to paint its painting the image borders either. I would like to still have the image over there and paint just the "background" of a PNG image just like this script: "http://www.williammalone.com/articles/create-html5-canvas-javascript-drawing-app/#demo-sizes" <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE