bitmap

BitBlt a bitmap onto a splash screen

帅比萌擦擦* 提交于 2021-02-08 03:32:15
问题 I am working on a splash screen for a simple Direct3D game and although the screen itself is created and destroyed properly, the BITMAP meant to be projected onto the splash screen isn't showing up. I have this so far: //variable declarations HWND splashWindow = NULL; BITMAP bm; //window procedure LRESULT WINAPI SplashProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { switch( msg ) { case WM_DESTROY: PostQuitMessage(0); return 0; case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint

Create Tiff File from multiple BitmapImage

二次信任 提交于 2021-02-08 03:32:11
问题 Background: I'm developing Win 10 Universal App, have list of BitmapImage: List<BitmapImage> ImagesList = new List<BitmapImage>(); Each list item is created by converting byte[] to BitmapImage by this code: public async Task<BitmapImage> GetBitmapImage(byte[] array) { using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream()) { using (DataWriter writer = new DataWriter(stream.GetOutputStreamAt(0))) { writer.WriteBytes(array); await writer.StoreAsync(); } BitmapImage image =

Create Tiff File from multiple BitmapImage

可紊 提交于 2021-02-08 03:32:11
问题 Background: I'm developing Win 10 Universal App, have list of BitmapImage: List<BitmapImage> ImagesList = new List<BitmapImage>(); Each list item is created by converting byte[] to BitmapImage by this code: public async Task<BitmapImage> GetBitmapImage(byte[] array) { using (InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream()) { using (DataWriter writer = new DataWriter(stream.GetOutputStreamAt(0))) { writer.WriteBytes(array); await writer.StoreAsync(); } BitmapImage image =

How to convert list of Image file paths into list of bitmaps quickly?

房东的猫 提交于 2021-02-07 20:19:53
问题 ArrayList<String> imageFileList = new ArrayList<>(); ArrayList<RecentImagesModel> fileInfo = new ArrayList<>(); File targetDirector = new File(/storage/emulated/0/DCIM/Camera/); if (targetDirector.listFiles() != null) { File[] files = targetDirector.listFiles(); int i = files.length - 1; while (imageFileList.size() < 10) { File file = files[i]; if (file.getAbsoluteFile().toString().trim().endsWith(".jpg")) { imageFileList.add(file.getAbsolutePath()); } else if (file.getAbsoluteFile().toString

What size to store image on server to use with Android app

爱⌒轻易说出口 提交于 2021-02-07 14:20:56
问题 I have an Android app that allows the user to upload profile pics. They are stored 300px X 300px on the server. In the app, I use them in either 40dp X 40dp or sometimes 100dp X 100dp. The 40dp's images are in ListView 's. I actually use a very popular third party LazyList to store the images (using an ImageLoader class) in a cache. Here is the exact library. I simply show image in my adapter like this: imageLoader.DisplayImage(profileUrl, holder.iv1); I take the web URL and display it

Fast conversion of Bitmap to ImageSource [duplicate]

我们两清 提交于 2021-02-05 12:17:20
问题 This question already has answers here : fast converting Bitmap to BitmapSource wpf (2 answers) Closed 4 years ago . I'm programming in WPF(c#) for image processing purpose. What is fastet way for converting Bitmap to ImageSource ? 回答1: Try converting it to a BitmapImage first: public BitmapImage ConvertBitmap(System.Drawing.Bitmap bitmap) { MemoryStream ms = new MemoryStream(); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); BitmapImage image = new BitmapImage(); image.BeginInit();

Given a Drawable, how to mask it to a given shape?

余生颓废 提交于 2021-01-29 20:23:03
问题 Background I wanted (here) to see how to create an alternative to AdaptiveIconDrawable , but change its background drawable to be shaped in to a given Path . The problem Well, what I did worked for Bitmap, but I wanted to know if it's possible to convert a given Drawable directly to a Bitmap and even a Drawable that is shaped to the given Path , without creating extra Bitmap instances. What I've tried This is the current code : fun resizePath(path: Path, width: Float, height: Float): Path {

MapBox: Capture whole screen but mapboxmap turned out to be black

心已入冬 提交于 2021-01-29 20:18:03
问题 I am implementing a running tracker. My UI consists of a MapBox mapView and a display that contains a few layouts that make up the time, distance etc. The mapView takes up the top half of the parent layout while the display takes up the bottom half. After the run I want to take a screenshot of the screen and save the img as a Bitmap. However when I use the conventional way of getDrawingCache() , the part of the img that is the mapView becomes a black box. Anyone knows how to solve this

Android - Get filename and path of URI from mediastore

最后都变了- 提交于 2021-01-29 16:21:50
问题 I have an intent to select an image from The Gallery and then use that to load an image into an ImageView item. BUT the image doesn't rotate in the right way so I should use ExifInterface class and exif constructor wants the file's path as String not as URI. And to convert URI into string I wrote this method: private String getRealPathFromURI(Uri contentURI) { String result; String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = getActivity().getContentResolver() .query(contentURI,

Given a Drawable, how to mask it to a given shape?

人盡茶涼 提交于 2021-01-29 16:20:54
问题 Background I wanted (here) to see how to create an alternative to AdaptiveIconDrawable , but change its background drawable to be shaped in to a given Path . The problem Well, what I did worked for Bitmap, but I wanted to know if it's possible to convert a given Drawable directly to a Bitmap and even a Drawable that is shaped to the given Path , without creating extra Bitmap instances. What I've tried This is the current code : fun resizePath(path: Path, width: Float, height: Float): Path {