bitmap

Converting an entire layout to an image/bitmap

和自甴很熟 提交于 2021-01-28 14:40:32
问题 I have been having an issue with this one line of code for a while and I would really apreciate it if any of you have ideaas about it. What I am trying to do is, save a specific layout( in this case a relative layout) as an image when a person hits a button. this action will transfer the image to the next activity. I'm pretty sure the actual act of transfering is not the problem. It's how I'm converting the layout to an image. below is the code with comments: Here is whats on activity1 //

how to avoid the error OOM when displaying bitmaps in recyclerView

孤者浪人 提交于 2021-01-28 12:23:12
问题 I am trying to show bitmap images in a 3 column gridViewLayout in recyclerView. but I receive OOM (Out of Memory) exception. Note that images are picked from gallery how can I solve this problem ?? This is my onBindViewHolder : @Override public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) { final byte[] data = arrayList.get(position).getAsByteArray("byteArray"); Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length); Glide.with(activity) .load

Move a bitmap around a window quickly in C++

眉间皱痕 提交于 2021-01-28 10:00:06
问题 I'm looking for some C++ code to let me quickly move a bitmap around a window, restoring the background as it moves. At present I capture the Window contents to a bitmap during the app initialization and in the OnPaint() I draw the this bitmap and then I draw my overlayed bitmap. I am double buffering the paint. The overlayed bitmap position moves with the mouse which invalidates the Window. This works fine except it is too slow when the background window is large (think Windows Desktop) and

What is the fastest way to convert JPEG byte data to raw greyscale byte information?

醉酒当歌 提交于 2021-01-28 09:22:09
问题 Since the Raw callback from takePhoto is not reliable I have to use the JPEG callback... What I'm basicly getting is a byte array which holds all the information in JPEG data-form. I now need to somehow get this to be only grayscale information with each pixel having a value of 0-255... At the moment I'm converting the jpeg data array to Bitmap using BitmapFactory.decodeByteArray and then converting the bitmap to grayscale by using getPixel(), which is pretty bad performance wise... Does

Bitmap appearance is not looking good, dithering is not working, in Android

淺唱寂寞╮ 提交于 2021-01-28 08:12:39
问题 I want to use coverflow view in my app. To get the reflection image part i have used the following code - http://www.androidsnippets.com/create-image-with-reflection I have seen lot of forums/discussions about dithering and tileMode, I have tried all that discussed but nothing works for me. FYI - I am creating a bitmap dynamically not using any bitmap in layouts. And I have attached the image to show how bad it is: I have listed below what I have tried to solve this issue. 1. getWindow()

Simple way to show a bitmap next to a menu item in a CMenu with correct transparency

妖精的绣舞 提交于 2021-01-28 05:19:07
问题 First off, I'm not a C++ developer, I program mainly in C#. I am trying to use the ContextMenu (yes I'm aware of ContextMenuStrip) class in .NET which is a wrapper around CMenu in my application. How do I display an image next to a menu item that has proper transparency? What I've done so far is call SetMenuItemBitmaps on my menu item, here is the attached result: As you can see there is a white background on the menu item. This is just so frustratingly close to what I want. How can I get the

Win32 dialog based borderless window with bitmap background and visual styles

老子叫甜甜 提交于 2021-01-28 02:36:09
问题 i'm new to StackOverflow so forgive me for any stupid mistakes I make on the post. I'm having an issue to create a borderless window with a bitmap background using the Win32 API (no MFC) and a dialog based application. I'm using visual studio 2010. The issue only happens if I use the windows XP Visual Styles, by linking the common controls lib with the following snippet: #pragma comment(linker, \ "\"/manifestdependency:type='Win32' "\ "name='Microsoft.Windows.Common-Controls' "\ "version='6.0

How to use my own bitmap font in PIL.ImageFont?

六月ゝ 毕业季﹏ 提交于 2021-01-28 02:03:50
问题 I created a bitmap font, basically a 256x256 png image where each character occupies 8x8 tile. I want to use it with Pillow as ImageFont but there's no info on this in Pillow docs. It says I can load bitmap fonts like this font = ImageFont.load("arial.pil") but "PIL uses its own font file format to store bitmap fonts." so I guess png file won't work. How can I tell PIL to use said bitmap and where each character is on it? 回答1: Not a complete answer, but too much for a comment, and it may be

Win32 dialog based borderless window with bitmap background and visual styles

筅森魡賤 提交于 2021-01-27 21:30:24
问题 i'm new to StackOverflow so forgive me for any stupid mistakes I make on the post. I'm having an issue to create a borderless window with a bitmap background using the Win32 API (no MFC) and a dialog based application. I'm using visual studio 2010. The issue only happens if I use the windows XP Visual Styles, by linking the common controls lib with the following snippet: #pragma comment(linker, \ "\"/manifestdependency:type='Win32' "\ "name='Microsoft.Windows.Common-Controls' "\ "version='6.0

Unable to convert vector drawable to bitmap drawable in android

故事扮演 提交于 2021-01-27 13:45:47
问题 I am trying to convert a bitmap to byte array in which i have taken an vector drawable image to bitmap and then i have converted it to byte array but when i open the application it shows me an error class cast exception unable to convert vector drawable to bitmap drawable. Resources res = getResources(); Drawable drawable = res.getDrawable(R.drawable.ic_motorcycle_black); if (drawable != null) { drawable.setColorFilter(0xffff0000, PorterDuff.Mode.MULTIPLY); } Bitmap bitmap = ((BitmapDrawable)