graphics

Graphics in C# (.NET)

I use this code for drawing text in a panel: Graphics g = panel1.CreateGraphics(); g.DrawString(...); So I want to know what size the input text will be when rendered in the panel. ...

Drawing graphics on top of a JButton

I have a situation wherein I have a bunch of JButtons on a GridLayout. I need each of the JButtons to have: a background image (but retain the ability to keep the default button look if needed) custom graphics drawn on top by other classes I have no trouble with the background image, since I am using setIcon() but I am having problem...

Tweenmax : is it possible to tween a sprite linestyle ?

Hi, I'm using TweenMax to make all tweens, fade in a projet. Now my question is : is it possible to tween only linestyle from a Sprite ? For example, something like that : TweenMax.to ( my_sprite.graphics.lineStyle, 0.5, { tint : 0xFF0000 } ); Thank you. ...

Where can I get graphics for startup screens?

I really like to have some graphic on my startup/login screen when starting my applications. In one of my past employments, we had this on startup/login screen: Where do you get your graphics for this purpose, and what are your favorites. ...

Is there any disadvantage to using only high resolution image resources for an Android application?

The Android documentation says that best practices are to make two drawable directories - one for HDPI and one for MDPI. It also says that if the MDPI directory doesn't exist and a MDPI device is running the app, it will scale down the HDPI ones so everything looks good. Is there any reason not to just make one high resolution set of g...

How do you represent a normal or texture coordinate using GLshorts?

A lot of suggestions on improving the performance in iPhone games revolve around sending less data to the GPU. The obvious suggestion is to use GLshorts instead of GLfloat wherever possible, such as for vertices, normals, or texture coordinates. What are the specifics when using a GLshort for a normal or a texture coordinate? Is it poss...

Adobe Fireworks CS4 Queries

Hi, I am new to Firewroks CS4 and keen to learn to use it right but I am having difficulty understanding the whole slicing and exporting mechanism, so that I can also use in Dreamweaver CS4. Basically, I am unsure how to do the following and if anyone can assist with the process or point me to a possible online tutorial, that would be ...

C# Graphics Book

I'm interested in using C# for graphics work. The book I have doesn't seem very interested in graphics. Could someone suggest a book that is more graphics-oriented? I am also interested in C interfacing with Excel. I'd be very grateful for any advice. Thanks! ...

Rotate Bitmap (Rectangle) While Maintining Area

How can I rotate an Bitmap a given number of degrees while maintaining the area of the original bitmap. ie, what I rotate a bitmap of Width:100,Height:200, my end result will be a bigger image but the rotated portion will still have an area of 100*200 ...

C# Graphics without Windows form

Hi, Could someone provide an example of drawing graphics without a windows form? I have an app that doesn't have a console window or windows form, but i need to draw some basic graphics (lines and rectangles etc.) Hope that makes sense. Thanks in advance.. J ...

Connect 4 C# (How to draw the grid)

I've worked out most of the code and have several game classes. The one bit I'm stuck on at the moment, it how to draw the actual Connect 4 grid. Can anyone tell me what's wrong with this for loop? I get no errors but the grid doesn't appear. I'm using C#. private void Drawgrid() { Brush b = Brushes.Black; Pen p = Pens.Black; ...

Defining Light Coordinates

I took a Computer Graphics exam a couple of days ago which had extra credit question like the following: A light can be defined in one of two ways. It can be defined in world coordinates, e.g. a street light, or in the viewer (eye coordinates), e.g., a head-lamp worn by a miner. In either case the viewpoint can freely change. Describ...

Using PHP's GD functions, how can I create an ellipse that is anti-alised and has a transparent background (PNG24 with alpha)?

I'm able to draw a circle on a transparent background, but it's pixelated around the edges. I can also get an anti-aliased circle on a non-transparent background with http://mierendo.com/software/antialiased_arcs/. So, how do I get both? ...

Different cursor formats in IOFrameBufferShared

I'm reading the moust cursor pixmap data from the StdFBShmem_t structure, as defined in the IOFrameBufferShared API. Everything works fine, 90% of the time. However, I have noticed that some applications on the Mac set a cursor in a different format. According to the documentation for the data structures, the cursor pixmap format should...

What pixel format does X server use?

What pixel format (RGBA, ARBG, BGRA) does the X server use? If any specific format at all. Update: I'm specifically looking for information about the color component order and bit patterns. ...

Resize PNG image

HI! Could you please tell me how to resize a .png image. Or better give an example. I've been searching for the answer for a long time and it seems that nobody knows how to resize a .png image and keep its transparency. :( ...

Computer graphics: programatically create duotone (or separations)

There are special kind of images called "duotone" which have just two channels. It is mostly used when you want to achive higher quality reproduction - have a printing press with two colors (black , gray). My question is, I have normal gray-scale image, how to convert it to duotone? I know I can tweak the curves in Photoshop - this is ...

Algorithm to create an image of an elliptical brush?

I need to be able to accept elliptical(computed) brush parameters such as spacing, hardness, roundness, angle and diameter and then compute a bitmap image based on those attributes. Does anyone know the algorithm(or where I can find it) to do this? I have limited experience in graphics programming and I have been unable to find it so f...

The Maths for 2D Collision Detection between an OBB and a Circle

I'm creating a 2D game and want to test for collision between an OBB (Oriented Bounding Box) and a Circle. I'm unsure of the maths and code to do this. I'm creating the game in c++ and opengl. ...

getting window screenshot windows API

Hi, I am trying to make a program to work on top of an existing GUI to annotate it and provide extra calculations and statistical information. I want to do this using image recognition, as I have learned a fair amount about this in University using Matlab and similar things. I can get a handle to the window I want to perform image reco...