graphics

.NET graphics Ghosting

拈花ヽ惹草 提交于 2019-12-21 21:30:01
问题 I'm making a sample GUI for a new application we are developing at work. The language has already been decided for me, but I am allowed to use any 3rd party DLLs or add-ins or whatever I need in order to make the GUI work as seamlessly as possible. They want it very mac/ubuntu/vista/Windows 7-like, so I've come up with some very interesting controls and pretty GUI features. One of which are some growing/shrinking buttons near the top of the screen that increase in size when you mouse over

C#: How to reduce memory and CPU consumption when working with Bitmaps?

一曲冷凌霜 提交于 2019-12-21 21:21:34
问题 I have a Windows Application project that deals with Image editing (Cropping & Resizing). Unfortunately these image processings consume a lot of Memory and CPU resources (easily reaches 600MB or 50% cpu) and it is all about cropping and resizing just one gif image that weighs 2.5MB (2300*5400px). More than that, due to large resource consumption, the program gets stuck while resizing... public static Image Resize(Image imgToResize, Size size) { Bitmap b = new Bitmap(size.Width, size.Height);

Save a plot as PNG and PDF only by one call to the plot function in R

可紊 提交于 2019-12-21 21:12:02
问题 I would like to have a plot in both pdf and png formats: pdf("test.pdf") plot(sin, -pi, 2*pi) dev.off() png("test.png") plot(sin, -pi, 2*pi) dev.off() But, I am searching for a trick (preferably, not by loading a new package) in which plot function only be called once: #no plot in pdf! pdf("test1.pdf"); png("test1.png") plot(sin, -pi, 2*pi) dev.off(); dev.off() Any suggestion would be appreciated. 回答1: You can use dev.copy() for your purpose. For instance: pdf("test.pdf") a<-dev.cur() png(

Use octree to organize 3D volume data in GPU

☆樱花仙子☆ 提交于 2019-12-21 21:03:36
问题 I am now trying to implement Ray Casting Volume Rendering using C++, OpenGL and GLSL (for GPU speeding). In order to get better quality and performance, I want to use octree to organize the 3D medical volume data,so I can use some algorithm such as Space Leaping and Adaptive Sampling easily. But how to build the octree effectively? How to visit the octree? When the ray travels in the volume data, how can I determine which cell or leaf of the octree the sample point belong? 回答1: There is an

How to draw a single line using MouseMove Event

点点圈 提交于 2019-12-21 20:56:09
问题 I'm trying to draw a single line using OnMouseMove() event. My Problem is that everytime I move the mouse It leaves a trail. I tried to use the refresh method, but when I stop moving the mouse the line is gone. I don't want the line to be drawn OnPaint(); , Just want to draw it OnMouseMove() . EDIT: I'm using a transparent panel(cp.ExStyle |= 0x20;), so I cant use the graphics.Clear() and BackColor() Here's a Sample Image without the Refresh() : Here's my code: private void panel1_MouseMove

Luminance Matching Two Colors

狂风中的少年 提交于 2019-12-21 20:52:57
问题 This will likely seem like a very easy thing I'm trying to do but Google search has not turned up exactly what I'm looking for and I'd like to do this correctly. Essentially I need to luminance match two bmps. They are simple circles (125x125 pixels) and their original color is only know to me by their (0-255 ranged) RGB value of 255,0,0. I need to find an RGB value of gray that is the same luminance of these circles. All other luminance/brightness matching tutorials I have seen have been for

Good image gallery engines

为君一笑 提交于 2019-12-21 20:51:43
问题 What are the best open source image gallery engines? Both stand-alone, and for existing frameworks such as Wordpress or Drupal. Hopefully we can build a good list here over time. 回答1: Gallery is the classic choice. It has skins, security layers, heaps of plugins, etc, but can be run with the default settings easily if you want to. I've used it for years. 回答2: GOOD QUESTION, lots of people ask this in many web forums so hopefully we will get some good responses to this, and have a good list of

Ruby graphic libraries

半城伤御伤魂 提交于 2019-12-21 20:37:33
问题 What's the difference between RMagic, ImageMagick, GD, etc. and which one should I use? I was looking for a thumbnail generation script and noticed that every script I found uses a different library for the same thing. 回答1: Imagemagick, GD, DevIL, and GraphicsMagick are libraries used to create and edit image files. RMagick is a ruby wrapper around ImageMagick/GraphicsMagick. You may find other wrappers I've had luck installing and configuring GraphicsMagick (similar to ImageMagick) and using

Find Coordinates for point on screen?

南楼画角 提交于 2019-12-21 20:36:47
问题 The thing is I have some graphics shown in a form, rectangle for example, and I want to capture when the point gets over thees fields. So I Thoght I try to find the corrrdinates for thees rectangles, but as thay are the coords in the form it dose not match the ones with the mouse location. So I wonder is there a way to find what coord on the screen a Point has on the screen and not in the form or controller? 回答1: Each control hs PointToFoo methods for conversion. Note that you should call

SVG to Java Graphics2D

痴心易碎 提交于 2019-12-21 20:36:31
问题 Can anyone suggest some good way to generate Graphics2D object form SVG data? I've seen Apache Batic lib, but it seams that they use some JSVGCanvas that gets the URI etc… And I want a Graphics2D stuff instead of JComponent. Thanks for any suggestions! 回答1: Try to look at SVG Salamander library. On this page there are some starting tips. It's a good thing if You want only to draw some svgs. 回答2: You can also use the Flamingo SVG Transcoder, it generates pure Java2D code from a SVG file with