bitmap

Why do I need to save handle to an old bitmap while drawing with Win32 GDI?

大城市里の小女人 提交于 2021-02-10 11:53:58
问题 Here is the code from switch in WndProc function I've been given as an example: case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // Create a system memory device context. bmHDC = CreateCompatibleDC(hdc); // Hook up the bitmap to the bmHDC. oldBM = (HBITMAP)SelectObject(bmHDC, ghBitMap); // Now copy the pixels from the bitmap bmHDC has selected // to the pixels from the client area hdc has selected. BitBlt( hdc, // Destination DC. 0, // 'left' coordinate of destination rectangle. 0, // 'top'

How to implement the scanline access of TBitmap correctly?

帅比萌擦擦* 提交于 2021-02-08 15:26:10
问题 I am trying to access the scanline of a Bitmap according to an article on Embarcadero. Using scanlines like for y := 0 to n do begin line := bitmap.scanline [y]; for x := 0 to n do line [x] := value; I have implemented before. I noticed that accessing a scanline takes relatively much time and the article mentioned above offers a solution to that. I am not able to implement it correctly. My code is: unit SCTester; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics,

get average value of red channel from bitmap using Renderscript android

陌路散爱 提交于 2021-02-08 10:12:24
问题 I'm currently working in an android application where i need to compute the average value of red channel in a bitmap and i just discovered Renderscript that has a fast way to access bitmap pixels. However until now i modified google developer page's code and failed to do want i wanted and here is my code: Sript: int *sum; uchar4 __attribute__ ((kernel)) invert(uchar4 in, uint32_t x, uint32_t y){ uchar4 out = in; sum[0] += in.r; out.r = 255 - in.r; out.g = 255 - in.g; out.b = 255 - in.b;

Saving WPF bitmap effect resultant image

。_饼干妹妹 提交于 2021-02-08 07:26:41
问题 I have a image to be displayed in the page and then apply some visual effects to the image. e.g Bevel effect. Once the effect is applied successfully is there a way to save the resultant image? 回答1: you can do something like this private void SaveImage() { try { SaveFileDialog saveDialog = new SaveFileDialog(); saveDialog.Filter = "JPeg Image(*.JPG)|*.jpg|Bitmap Image(*.BMP)|*.bmp|Png Image(*.PNG)|*.png|Gif Image(*.GIF)|*.gif"; if (saveDialog.ShowDialog().Value == true) { // Save current

Saving WPF bitmap effect resultant image

你离开我真会死。 提交于 2021-02-08 07:26:22
问题 I have a image to be displayed in the page and then apply some visual effects to the image. e.g Bevel effect. Once the effect is applied successfully is there a way to save the resultant image? 回答1: you can do something like this private void SaveImage() { try { SaveFileDialog saveDialog = new SaveFileDialog(); saveDialog.Filter = "JPeg Image(*.JPG)|*.jpg|Bitmap Image(*.BMP)|*.bmp|Png Image(*.PNG)|*.png|Gif Image(*.GIF)|*.gif"; if (saveDialog.ShowDialog().Value == true) { // Save current

Android a seekbar for adjusting bitmap brightness

久未见 提交于 2021-02-08 06:41:07
问题 I have tryed many codes, and looked at Android developers but couldn't make it work. I want the seek bar to adjust my bitmap image brightness 回答1: check the example given at Increase/Decrease Brightness of Image and do as shown below on seekbar progress changes int brightness; SeekBar seekbarbrightness=(SeekBar)findViewById(R.id.seekBar1); seekbarbrightness.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar arg0) { // TODO Auto

Android a seekbar for adjusting bitmap brightness

自作多情 提交于 2021-02-08 06:41:07
问题 I have tryed many codes, and looked at Android developers but couldn't make it work. I want the seek bar to adjust my bitmap image brightness 回答1: check the example given at Increase/Decrease Brightness of Image and do as shown below on seekbar progress changes int brightness; SeekBar seekbarbrightness=(SeekBar)findViewById(R.id.seekBar1); seekbarbrightness.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar arg0) { // TODO Auto

How to show database image in Glide on Android?

风格不统一 提交于 2021-02-08 05:16:54
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

How to show database image in Glide on Android?

断了今生、忘了曾经 提交于 2021-02-08 05:16:33
问题 I have a SqliteDatabase in my application. In this database, I save Sting and Blob(for save image) . This image is saved in application with byte[ ] . I convert this image to Bitmap with the help of following code: byte[] Recycler_imageByte; Bitmap Recycler_theImage; holder.Recycler_imageByte = data.get(position).getKey_image(); ByteArrayInputStream imageStream = new ByteArrayInputStream(holder.Recycler_imageByte); holder.Recycler_theImage = BitmapFactory.decodeStream(imageStream); I want to

BitBlt a bitmap onto a splash screen

£可爱£侵袭症+ 提交于 2021-02-08 03:34:45
问题 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