bitmap

android bitmap pixel format for glTexImage2D

倖福魔咒の 提交于 2020-01-14 14:49:06
问题 I'm trying to load textures to use with NDK OpenGL from Java with the Bitmap class. It works, but I'm having problems with the pixel format. First, in Java, I load a bitmap from the assets folder like this: Bitmap bitmap = BitmapFactory.decodeStream(amgr.open(path)); return bitmap.copy(Bitmap.Config.ARGB_8888, false); the bitmap config does not have an option for RGBA channel order. [JNI things happen here] Using GLES 1, I then buffer the texture like so: glTexImage2D(GL_TEXTURE_2D, 0, GL

生成二维码图片

北慕城南 提交于 2020-01-14 13:44:45
string Name = ""; string imgFile = ""; if (prmember != null) { Name = prmember.Name; } string path = "/m-wap/HGProduct/ProductDetails?PID=" + prmember.ID + ""; string url = CreatUrl(path); ErcodeInfo info = new ErcodeInfo(); info.ID = id; info.Name = Name; info.Til = Name+"二维码"; info.URL = url; byte[] data = GenerRideCode.ShowImg(info); return File(data, "image/Png");    public class GenerRideCode { /// <summary> /// 转换成流的形式 /// </summary> /// <param name="matrix"></param> /// <returns></returns> public static Bitmap toBitmap(ByteMatrix matrix) { int width = matrix.Width; int height = matrix

How to perform an image stream preview to a Delphi 6 frame or form from a background thread efficiently?

微笑、不失礼 提交于 2020-01-14 12:37:12
问题 I have a Delphi 6 application that receives and processes an image stream from an external camera. I have the code on a background thread since it is CPU heavy and I don't want it interfering with with the user interface code that runs on the main thread. I want to update a rectangular area on a form or frame with the TBitmaps I create from the camera's JPEG frames that are received at a rate of 25 frames per second. I want to know what method will give me the best performance and what

How to perform an image stream preview to a Delphi 6 frame or form from a background thread efficiently?

痞子三分冷 提交于 2020-01-14 12:36:23
问题 I have a Delphi 6 application that receives and processes an image stream from an external camera. I have the code on a background thread since it is CPU heavy and I don't want it interfering with with the user interface code that runs on the main thread. I want to update a rectangular area on a form or frame with the TBitmaps I create from the camera's JPEG frames that are received at a rate of 25 frames per second. I want to know what method will give me the best performance and what

Images loading randomly into view pager with Glide and SimpleTarget

邮差的信 提交于 2020-01-14 10:36:09
问题 I'm using Glide to load image into a ViewPager using an PagerAdapter . When I load the images using the following method: Glide.with(mContext).load(mImage).placeholder(R.drawable.placeholder).into(mImageView); Everything works fine, but now I need to get the bitmap from glide and store it in a map when it loads for future edit, so I switched this method to the following one: Glide.with(mContext).load(mImage).asBitmap().placeholder(R.drawable.placeholder).into(new SimpleTarget<Bitmap>() {

Displaying a bitmap on a “BUTTON” class window in WIN32

孤街浪徒 提交于 2020-01-14 09:49:28
问题 Edit: I think the WM_CREATE message isn't sent during the creation of child windows (namely my button). So by calling SendMessage during WM_CREATE, I'm sending a message to a window that hasn't been created yet. The solution for now is to call SendMessage() during the WM_SHOWWINDOW message. Do child windows send WM_CREATE messages at creation? Why isn't the bitmap displaying on the button? The bitmap is 180x180 pixels. I have a resource file with: Bit BITMAP bit.bmp I then create the main

Is there a way to decode a .ICO file to a resolution bigger than 16x16?

眉间皱痕 提交于 2020-01-14 09:45:29
问题 I'm working on android and trying to download and display a favicon(.ICO) from a website on an ImageView. So far I've manage to read the .ico from a website using an HTTP connection, retrieve it as an InputStream. Then I use a BitmapFactory to decode the stream into a Bitmap and display it on the ImageView. Here's the code: public Bitmap getBitmapFromURL(URL src) { try { URL url = new URL("http", "www.google.com", "/favicon.ico"); HttpURLConnection connection = (HttpURLConnection) url

What is the difference between System.Drawing.Image and System.Drawing.Bitmap?

岁酱吖の 提交于 2020-01-14 07:15:51
问题 I am confused what's the different between System.Drawing.Image and System.Drawing.Bitmap Can someone explain the major difference between those two types ? And Why to use System.Drawing.Bitmap instead of System.Drawing.Image ? 回答1: Bitmap inherits from Image : System.Drawing.Bitmap : System.Drawing.Image { } Image is an abstract class, this means: The abstract modifier indicates that the thing being modified has a missing or incomplete implementation. Bitmap is a sealed class, this means:

What is the difference between System.Drawing.Image and System.Drawing.Bitmap?

半城伤御伤魂 提交于 2020-01-14 07:15:09
问题 I am confused what's the different between System.Drawing.Image and System.Drawing.Bitmap Can someone explain the major difference between those two types ? And Why to use System.Drawing.Bitmap instead of System.Drawing.Image ? 回答1: Bitmap inherits from Image : System.Drawing.Bitmap : System.Drawing.Image { } Image is an abstract class, this means: The abstract modifier indicates that the thing being modified has a missing or incomplete implementation. Bitmap is a sealed class, this means:

How to print bitmap without zoom from MVC controller in Debian

前提是你 提交于 2020-01-14 06:52:09
问题 Document is printed from MVC controller to Debian Squeeze Linux server printer using code below in Mono. Page in printer is A4. Printed text in paper is too big and unsharp. Rightmost part of text is not visible since it does not fit to page. If printed from Windows from .NET to HP Laserjet, output is correct. So it looks like Mono or Samsung ML-331x Series printer zooms bitmap for unknown reason which causes too big and unsharp output. How to fix this so that bitmap is printed like in