graphics

Fast method to rotate image in .NET Compact Framework in C#

最后都变了- 提交于 2019-12-11 20:47:15
问题 Is there a fast way to rotate images in .NET Compact Framework. I've found ways to do 90, 180,270, rotations but would like to be able to rotate images free form in similar speed. 回答1: 90-, 180- or 270-degrees rotations require no calculation at all, only moving some data. On the other hand, free-angle rotations require heavy calculations. So this will never ba as fast as right-angle rotations... 回答2: You can use OpenNetCF's ImageUtil class to do this (it's the "Rotate" method you're looking

GLUT is working fine but OpenGL is not doing anything

試著忘記壹切 提交于 2019-12-11 20:24:58
问题 The exact same code snippet is working on another machine but its not working properly for me. The GLUT is working absolutely fine as it open the created window but the line segment is not shown on the window which means there is a problem with opengl . It is not even changing the background color of the window. I even test the opengl on my windows with a testing application and its working fine. #ifdef WIN32 #include <windows.h> #endif #include <GL/glut.h> #include <GL/gl.h> #include <GL/glu

Point is not defined even though I imported graphics

社会主义新天地 提交于 2019-12-11 20:23:46
问题 So this is my class for a game called Zombie Dice. I've imported graphics but I get this error and I have no idea why. Please explain some possibilities for me. "File "<pyshell#0>", line 1, in <module> Game() File "C:\Users\Brandon\Desktop\FinalProject3.py", line 17, in Game Yellow = DieViewYellow(Gamewindow, Point(95,75),20) File "C:\Users\Brandon\Desktop\DieViewYellow.py", line 83, in __init__ p1 = Point(x-25, y-25) NameError: name 'Point' is not defined"> Here is my Die view class, which

Trying to cast an Image to a BufferedImage

戏子无情 提交于 2019-12-11 20:15:58
问题 I'm writing java code for a game and when creating the health bars I saw an exception that confused me greatly. The code and stack is below: Code: package com.teamanubiz.pixelhero; import java.awt.Graphics; import java.awt.Image; import javax.imageio.ImageIO; import javax.swing.ImageIcon; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import com.teamanubiz.gameapi.gfx.Sprite; public class GUIRenderLayer { public void renderStatBar(GUIPosition pos,

Java Applet, get the name of the colour being used in paint()

我与影子孤独终老i 提交于 2019-12-11 20:11:42
问题 When using the graphics object in the paint() method of a Java Applet, Does anyone know how to use a method on the graphics object whereby it will return the name of the color being used? After using g.setColor(Color.red); Then drawing a rectangle Ive tried using g.getColor().toString(); But this only returns a string like this: "java.awt.Applet[r:255 g:0 b:0]" Im looking to get back "Red" if its possible 回答1: It should be possible to do something like this if you really want to. I would

How to find custom shape speicific area?

*爱你&永不变心* 提交于 2019-12-11 19:45:18
问题 please , see following image, here you can see blue rectangle is custom shape bounds and custom shape is shoe , i want to find area of a portion written in image and i want that area in form of rectangle do is there any path iterator concept ? Note custom shape i derived from image of the same size. 回答1: I would do it like this: 1.create table for all bounding box-rect perimeter lines each value in it will represent the empty space length form border line to shape something like this: the

Change mouseover point in highcharts

痞子三分冷 提交于 2019-12-11 19:43:05
问题 Can somebody help me with my problem. I have this piecharts, and i need to change point( segment ), when i mouseover on it What the best way you can advise me? Maybe something like this, change point, but i don't know how to do this plotOptions: { series:{ point:{ events: { mouseOver: function( e ){ console.log( this ) } } } } }, 回答1: Try to update only graphic using element.attr() , see: http://jsfiddle.net/rh5fz92q/ plotOptions: { pie: { point: { events: { mouseOver: function(e){ this

Drawing parametric shapes in webGL (without three.js)

青春壹個敷衍的年華 提交于 2019-12-11 19:41:31
问题 I've written a program that draws some parametric shapes (spheres, toruses, and cylinders) just using HTML5 and regular Javascript. I'm trying to convert this code so that it uses WebGL, implementing the shapes with triangle strips as is done in this tutorial. My point of confusion is how triangle strips are even being used to create spheres at all. The way I was doing it before just featured the calculation of where to draw each horizontal slice or circle based on the latitude lines in a for

How to fix bad Double-Buffering [closed]

孤人 提交于 2019-12-11 19:18:40
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I tried following a double buffering tutorial, and I really don't know what I did wrong. It works before then before I did the tutorial, but there is still and occasional flicker here and there. I have two files

Convert a 2D array of ints to a greyscale image

半城伤御伤魂 提交于 2019-12-11 18:48:13
问题 I have a 2D array of ints ranging from 0 to 255, each representing a shade of grey. I need to turn it into a greyscale image. The width and height of the image are the number of columns and rows of the array, respectivly. I am using Microsoft Visual C# 2010 Express with the latest (I think) .NET framework as of Feb, 2013. Many other people have had this problem but none of the solutions posted have worked for me; they all seem to call methods that don't exist in my code. I think I might