alpha

Scale a Bitmap and preserve alpha, on BlackBerry

ⅰ亾dé卋堺 提交于 2019-12-02 07:02:28
I am trying to scale down a Bitmap that contains transparency. Unfortunately, all three methods I've tried result in white where there should be full transparency. I would like to maintain the transparency. The bitmap I am scaling is always square, so my functions assume that: private static Bitmap scale1(int edge, final Bitmap res) { int factor = edge == 0 ? Fixed32.ONE : Fixed32.div(res.getHeight(), edge); Bitmap scaled = PNGEncodedImage.encode(res). scaleImage32(factor, factor).getBitmap(); return scaled; } private static Bitmap scale2(int edge, final Bitmap res) { Bitmap val = new Bitmap

团队作业1——团队展示&选题

。_饼干妹妹 提交于 2019-12-02 07:02:11
一、 团队展示 (1) 队名:计科五班只有一个大哥 (2) 队员:刘友滨 3117004622 陈景山 3117004606(组长) 魏建雄 3117004631 金文涛 3117004613 卢悦盛 3117004623 陈浩锋 3117004603 (3) 团队项目描述:沟通与协调,互帮互助,各司其职,共同进步。 (4) 队员风采 刘友滨:java后端开发。希望能在团队中与队友互相学习、共同进步。 宣言:抱住大哥的大腿冲冲冲!!! 陈景山:有一颗热爱编程的心。宣言: 我就是大哥。 魏建雄:有点Java基础,缺乏团队项目经验,希望在此次团队项目中得到提升,偏测试方面。宣言:做大哥身后的男人。 金文涛:有点JS基础,有点团队项目经验,希望在此次团队项目中得到提升,偏开发方面。宣言:做大哥身后的男人。 卢悦盛:有java基础,在学习java前端编程。希望能在团队中了解项目开发流程,加强自己的能力。宣言:做一群大哥身后的男人。 陈浩锋:对于java编程有过些许经验,但编程效率和效果并不尽如人意(大概也是因为学习的深度还不够,知识积累还停留在比较浅薄的阶段)。前面的个人项目和结队项目让我学习到很多。而到团队项目,希望能跟着大哥们的步伐好好提升自己的编程能力。宣言:做大哥们臂膀下的六哥 (5) 合照: (6) 团队特色:1.清晰的目标

OpenGL transparency not working properly

白昼怎懂夜的黑 提交于 2019-12-02 06:20:23
问题 I have a problem with transparency in my project. As you can see, the transparency is working fine for other objects - you can see the rhino behind leaves, BUT the problem is with the tree itself. When there are two branches and one is closer than the other, the further one is not visible. Same with the trunk. The transparency is just not working for the object itself. This is the code I use when creating texture: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

How to draw text with image in background

自古美人都是妖i 提交于 2019-12-02 03:53:09
I want to make something like this python. I have the image in background and write text with transparent fill, so that image shows up. Here's one way I found to do it using the Image.composite() function which is documented here and here . The approach used is described (very) tersely in this answer to the question Is it possible to mask an image in Python Imaging Library (PIL)? by @Mark Ransom…the following is just an illustration of applying it to accomplish what you want do. from PIL import Image, ImageDraw, ImageFont BACKGROUND_IMAGE_FILENAME = 'cookie_cutter_background_cropped.png'

OpenGL transparency not working properly

牧云@^-^@ 提交于 2019-12-02 01:40:33
I have a problem with transparency in my project. As you can see, the transparency is working fine for other objects - you can see the rhino behind leaves, BUT the problem is with the tree itself. When there are two branches and one is closer than the other, the further one is not visible. Same with the trunk. The transparency is just not working for the object itself. This is the code I use when creating texture: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glGenTextures(1, &m_texture); glBindTexture(GL_TEXTURE_2D, m_texture); glTexParameteri(GL_TEXTURE_2D, GL

How do I make a png with transparency appear transparent in MatLab?

一世执手 提交于 2019-12-01 21:38:30
I have an image with a transparent background, but when I open it in MATLAB, I get a black background. I'm overlaying it on top of a background image. How can I get this to display? I've tried using the alpha function alpha(image,0) but it sets my entire image to 0. Is it possible for me to set the alpha of individual pixels to be equal to 0? That way I can run each pixel through a loop. I'm not sure if this helps, but when I run a imfinfo('ryu1.png') , I get : ... Transparency = 'alpha' SimpleTransparencyData = [] ... rayryeng You can read in your image using imread . However, you need to

ggplot2: geom_ribbon with alpha dependent on data density along y-axis for each x

只愿长相守 提交于 2019-12-01 17:34:52
Is there a way in ggplot2 to produce a geom_ribbon (or other area based geom) with a varying alpha based on the density of points? The following code produces 50 noisy sine waves, with random x-values for each sample. I don't want to draw every single point as I might want a thousand or more resamples, so I'd like to summarise all these points. A simple method would be to draw a geom_ribbon covering 95% quantiles. However, firstly this isn't that easy to calculate given the x-values aren't the same for each resample; normally you'd calculate the pointwise quantiles at each of the 100 x points.

How to make MapView object transparent (alpha)?

空扰寡人 提交于 2019-12-01 14:33:48
All, I have a need to display information on a MapView object. No problems there. The issue is that there are times when the MapView object displays map details that visually compete with my overlay data. So, what I'd like to do is provide a way to "scale back" the MapView object visually by using an alpha channel. Can an alpha value get applied to a MapView object? If so, how? Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the alpha of this overlay and I might end up with the same overall effect. Insight please. Thanks. Rich Are

What do “.subsurface()”, “.convert_alpha()”, and “%” do?

和自甴很熟 提交于 2019-12-01 14:02:50
问题 I'm trying to learn Pygame, and the tutorial that I am following has a section explaining how to animate sprites. It gives me a sprite sheet that has 8 images measuring 128x128 each, while the entire sheet measures 1024x128. Then it presents the following code: #! /usr/bin/env_python import pygame, sys from pygame.local import * pygame.init() ZONE = pygame.display.set_mode((400,300)) pygame.display.set_caption("Game Zone") RED = (255,0,0) clock = pygame.time.Clock() counter = 0 sprites = []

How to make MapView object transparent (alpha)?

不羁岁月 提交于 2019-12-01 12:42:08
问题 All, I have a need to display information on a MapView object. No problems there. The issue is that there are times when the MapView object displays map details that visually compete with my overlay data. So, what I'd like to do is provide a way to "scale back" the MapView object visually by using an alpha channel. Can an alpha value get applied to a MapView object? If so, how? Alternatively, I was thinking that perhaps a separate all black overlay might provide the same results. Scale the