graphics

Change background colour of an anti-aliased image using C# with anti-aliasing

一个人想着一个人 提交于 2019-12-22 10:44:26
问题 I have an image where I need to change the background colour (E.g. changing the background of the example image below to blue). However, the image is anti-aliased so I cannot simply do a replace of the background colour with a different colour. One way I have tried is creating a second image that is just the background and changing the colour of that and merging the two images into one, however this does not work as the border between the two images is fuzzy. Is there any way to do this, or

Does anybody know good graphical morphing code or algorithm?

末鹿安然 提交于 2019-12-22 10:28:31
问题 I'm building a small app and I need to be able to morph one image into another. Any pointers would be appreciated. 回答1: If you remember the Michael Jackson Video for Black or White, they used the Beier-Neely algorithm. I did a project as an undergraduate using that algorithm for a graphics class and found it pretty straight forward to use. If you just need something to perform morphing, there is probably an implementation out there that you could use. If you need to build something and

Tree visualisation and animation

蹲街弑〆低调 提交于 2019-12-22 09:56:10
问题 I'm working with multiple search strategies on trees in Haskell. I want to visualize them and also animate the search I'm doing in it. The best I've found so far is graphviz images that I could generate by writing DOT files (like in Land of Lisp) but I doubt that it is the best approach. My trees can get quite big so I don't want to enter the position of each node in my program, I want them to be places correctly automatically. I've also looked a little bit at Gephi but I'm not sure if I can

How do I print SVGA Info on the screen in tasm?

主宰稳场 提交于 2019-12-22 09:50:10
问题 I am complete beginner to assembly, and graphics, any help would be appreciated. I got the svga info, but when i print it, it won't print anything. If anyone can explain why that would be great. Here is the code. If there is anymore explanations needed for what I have done let me know .MODEL SMALL .STACK 64 .DATA getinfo: VbeSignature db 'VESA' ; VESA VbeVersion dw 0000h ; Version OemStringPtr dd ? ; Producer Capabilities db 4 dup (?); Reserved VideoModePtr dd ? ; Modes TotalMemory dw ? ;

please explain this Bresenham Line drawing code for me

一世执手 提交于 2019-12-22 09:49:45
问题 I have searched throughout the Internet and found hundreds of implementation of Bresenham's line drawing algorithm. But, one thing I found strange is, only two or three of them can cover all of the eight octets. still, they are being used in many applications. For example, this lady implemented this version (line 415) of Bresenham's algorithm. But, it doesn't cover the whole 360 degrees. This guy here seems to be developing a library. But still it doesn't work properly. Can you tell me why?

Stretching Polygon to other Polygon with Java

眉间皱痕 提交于 2019-12-22 09:39:33
问题 My problem is that I have a rectangle presented with a small perspective, and I would like to stretch it back to be presented as a rectangle again. To represent it visually, I currently have within my image something like the red shape, and I have 4 Points (each corner of this shape). As result I would like to have something like the blue shape, and I already have the Rectangle object for it. I was wondering if there is a method to copy a polygon and draw it as another polygon stretched. I

Least distance from a point to an area

为君一笑 提交于 2019-12-22 09:38:59
问题 I am trying to find a point (P2) in a closed area that has the minimum distance to a point (P1). The area is built of homogenous pixels, it is not shaped perfectly and it is not necessarily convex. This is basically a problem of reaching an area from the shortest path. The whole space is a stored in the form of a bitmap in the memory. What is the best method to find P2? Should I go with random search (optimization) methods? Optimization methods do not give the exact minimum but they are

Add 'fake' antialiasing to rotated rectangle

柔情痞子 提交于 2019-12-22 09:33:56
问题 I'm using Corona SDK, which fairly recently disabled antialiasing, without a way to re-enable it. I have several apps that use rotated rectangles and lines, and would like a way for to not look jagged. This image shows the difference: Is there a way to add some sort of antialiasing to these rectangles in Corona? I'd much prefer an antialias hack and be able to use new Corona features and fixes than use an old build with antialiasing.] Thanks! 回答1: You can use masks to your rects or images, it

System.Drawing.Graphics

萝らか妹 提交于 2019-12-22 09:25:21
问题 I have one problem relating to rotate ellipse by given Center, Suppose I have one ellipse and what should be is to rotate that ellipse by point given by user and ellipse should be rotate around that given point. I have tried g.RotateTransform(…) g.TranslateTransform(…) Code: Graphics g = this.GetGraphics(); g.RotateTransform((float)degreeArg); //degree to rotate object g.DrawEllipse(Pens.Red, 300, 300, 100, 200); this works fine but how can we give our out center to rotate ellipse.... How

Java custom Paint implementation performance issue

只愿长相守 提交于 2019-12-22 09:20:21
问题 I'm using Java to create a game, and I'm using TexturePaint to texture areas in the background. Performance is fine using java.awt.TexturePaint, however, I want to have areas having an inherent rotation, so I tried implementing a custom Paint called OrientedTexturePaint: public class OrientableTexturePaint implements Paint { private TexturePaint texture; private float orientation; public OrientableTexturePaint(TexturePaint paint, float orientation) { texture = paint; this.orientation =