graphics

changing the intensity of lighten/darken on bitmaps using PorterDuffXfermode in the Android Paint class

主宰稳场 提交于 2019-12-21 20:34:12
问题 Ok my orignal question has changed. How do i change the intensity of how something like this is effected? DayToNight.setXfermode(new PorterDuffXfermode(Mode.DST_IN)); in my dream world it would have worked like this DayToNight.setXfermode(new PorterDuffXfermode(Mode.DST_IN(10))); the 10 being a level of intensity. An example would be if I had a flickering candle, when the candle burns bright I want the bitmaps I am drawing to the screen to retain their origanol color and brightness, when it

draw circle on bitmap

余生长醉 提交于 2019-12-21 20:09:15
问题 i've written an app that captures a picture and saves it on the sdcard. i then can load that image into an imageview to display it. i'd like to draw a circle on the bitmap before i display it. the code below displays the bitmap but no circle, any ideas why the circle is not there? thanks. BitmapFactory.Options bfo = new BitmapFactory.Options(); bfo.inSampleSize = 5; Bitmap bm = BitmapFactory.decodeByteArray(imageArray, 0, imageArray.length, bfo); Log.e(TAG, bm.toString()); //imageview

How to make a .exe for Python with good graphics?

岁酱吖の 提交于 2019-12-21 19:58:48
问题 I have a Python application and I decided to do a .exe to execute it. This is the code that I use to do the .exe: # -*- coding: cp1252 -*- from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 1}}, windows = [{'script': "SoundLog.py"}], zipfile = None, packages=[r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Auxiliar", r"C:\Users\Public\SoundLog\Code\Código Python\SoundLog\Plugins"], ) But when I run my

Generating a list of colors, blue through red, 0% through 100%

喜欢而已 提交于 2019-12-21 19:57:02
问题 I want to create a list of colors, red-yellow-green-blue, and blend into each other across a span of 100. Anyone have experience in this sort of thing? Edit: Well, RGB actually. Any language will do. I just need the algorithm. 回答1: A simple nested RGB loop would not generate your red-yellow-green-blue gradient. If that is really what you specifically want then you should know a bit about the color wheel: red | magenta__ | __yellow \|/ __/|\__ blue | green | cyan This is actually a HSV color

Why does System.Drawing.Graphics blank the RGB channels when Alpha==0?

烂漫一生 提交于 2019-12-21 19:46:51
问题 This has become a serious blocker for a program I'm working on to manipulate images that have Alpha channels. Many of the images I have contain color information where an Alpha channel is completely transparent, and yet as soon as I try to load them into System.Drawing.Graphics, it changes anything with of Alpha of 0, into Black with an Alpha of 0. Here is a basic sample of the issue. I have looked around trying to find a reason, answer, or workaround, but I haven't found anything that even

Replace specific color in bitmap with transparency

房东的猫 提交于 2019-12-21 19:28:10
问题 I have a method to replace a pixel of one color with transparency public Bitmap createTransparentBitmapFromBitmap(Bitmap bitmap, int replaceThisColor) { if (bitmap != null) { int picw = bitmap.getWidth(); int pich = bitmap.getHeight(); int[] pix = new int[picw * pich]; bitmap.getPixels(pix, 0, picw, 0, 0, picw, pich); int sr = (replaceThisColor >> 16) & 0xff; int sg = (replaceThisColor >> 8) & 0xff; int sb = replaceThisColor & 0xff; for (int y = 0; y < pich; y++) { for (int x = 0; x < picw; x

Framebuffer/Color Buffer?

不羁岁月 提交于 2019-12-21 17:52:29
问题 Can someone point out to me if both of them are the same? I mean I have been reading info about it and this redbook here says "The color buffer itself can consist of several subbuffers. The framebuffer on a system comprises all of these buffers" here Is framebuffer then like a virtual buffer consisting of all the actual buffers ?(like depth/stencil etc) 回答1: The framebuffer contains (often) the depth, stencil, color, and accumulation buffers. The color buffers are the most important part, but

Bump Mapping on the iPhone

泄露秘密 提交于 2019-12-21 17:32:13
问题 Using OpenGL ES on the iPhone, is it possible to do bump mapping (using normal perturbation maps)? From my google searching, it seems the OpenGL ES extension that supports it doesn't allow bump mapping. According to this guy that writes gaming middleware for the iphone, one can see the potential of the hardware by watching demos on th imgtec site (the marker of the iPhones graphics chip). One such demo is a bump mapping demo. But there's no source to be found. Kevin Doolan also mentions the

How to group multiple objects for purpose of rotating them as a unit?

主宰稳场 提交于 2019-12-21 17:24:58
问题 I need some pointers on the best approach for a rotation task in OpenGL. I know how to rotate objects in 3D space using quaternions, I can translate them, all well and good. But I want to know the best way to treat a collection of different objects as a single entity for the purpose of rotation. For example, suppose you have a desk with objects on it. Each has its own translation and rotation, but now I want to rotate the entire desk and everything on it, while keeping other objects in the

How to sharpen a image in android?

て烟熏妆下的殇ゞ 提交于 2019-12-21 17:19:13
问题 I want to sharpen a image, my code is given below: public Bitmap RuiHuaBitmap(Bitmap bitmap) { int width, height; height = bitmap.getHeight(); width = bitmap.getWidth(); int red, green, blue; int a1, a2, a3, a4, a5, a6, a7, a8, a9; Bitmap bmpBlurred = Bitmap.createBitmap(width, height,bitmap.getConfig()); Canvas canvas = new Canvas(bmpBlurred); canvas.drawBitmap(bitmap, 0, 0, null); for (int i = 1; i < width - 1; i++) { for (int j = 1; j < height - 1; j++) { a1 = bitmap.getPixel(i - 1, j - 1)