Questions tagged [cimage]

14 questions
3
votes
0 answers

CIImage says `Cannot render image (with an input Metal texture) using a metal context.`

I am attempting to convert a MTLTexture to a CGImage by adding an extension function to MTLTexture objects inside of my macOS playground. The current function looks like this: extension MTLTexture { func toImage() -> CGImage? { let…
J.Doe
  • 1,502
  • 13
  • 47
2
votes
0 answers

Problem trying to screen capture a specific monitor to a thumbnail (on Clipboard)

My ultimate goal here is to try and display a small list of monitor thumbnails on a dialog. This is so that the user can click on one of those thumbnails and I then perform a certain action for them. I have found out how to use EnumDisplayMonitors…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1
vote
1 answer

Changing the color of pixels using (MFC's) CImage::SetPixel()

I have a 32-bit png file with an alpha (transparent) layer. I want to change the color of some pixels on a per-pixel basis using MFC. Performance isn't an issue (although faster is better). I wrote code to call CImage::GetPixel() tweak the returned…
Steve A
  • 1,798
  • 4
  • 16
  • 34
0
votes
0 answers

Im trying to figure out how to make this code print out a gray scale image. My teacher wants us to use this code to make it yet I've been stuck

from cImage import * fileImageName = "butterfly.png" def getNegativePixel(oldPixel): newRed = 255 - oldPixel.getRed() newGreen = 255 - oldPixel.getGreen() newBlue = 255 - oldPixel.getBlue() newPixel = Pixel(newRed, newGreen,…
0
votes
1 answer

Why is my stretchblt images losing colours?

I am having some difficulties in correctly populating a CListCtrl with thumbnails of monitor displays. On the right of my CDialog I have a static control and I render the image on a white canvas like this: void…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
1 answer

How do I put all three images horizontally?

I have a function that changes the original image to gray scale, negative image and the color yellow to blue. The code is supposed to run and show the images in 3 different windows. How can I put them all in one, horizontally? here is the code. p.s…
Perfectoid
  • 15
  • 2
0
votes
1 answer

What is the correct way to cater for loading another image when there is already an image loaded into the CImage object?

I thought I would try my code in debug mode: void CSpecialEventVideoconferenceInfoDlg::OnEnChangeBrowseSpecialEventVideoconfPathImage() { CString strImagePath; GetDlgItemText(IDC_BROWSE_SPECIAL_EVENT_VIDEOCONF_PATH_IMAGE, strImagePath); …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
0 answers

Image resize with CImage VS2019 C++

I am using a CImage class to save screenshots of the desktop. Since the desktop is in 1920x1080 the images are also in 1920x1080. However, since i want to do some work on those images and their size makes it very computationally expensive and slows…
Abrar3616
  • 9
  • 1
0
votes
1 answer

ATL CImage::SetPixel not working for monochrome BMPs (nBPP=1)

I'm trying to code a program that changes a BMP file and adds some modifications in particular locations. The BMPs I'm trying to modify are monochrome (1 bit per pixel) as the image size needs to be quite small. I'm using the ATL CImage class to do…
0
votes
1 answer

Python-3, my program doesn't show a negative image

So I need to follow the function in my textbook, to make an image negative and show the negative image. I've tried changing a few things in to replicate the previous function see to if that would change anything like typing in what image I want to…
0
votes
0 answers

Trying to display a CImage on a CDialog in OnPaint handler

I have a JPG resource in my MFC application. I try to load it like this in OnInitDialog: m_imgSplash.LoadFromResource(AfxGetResourceHandle(), IDR_SPLASHSCREEN); Then, in the OnPaint handler I do the following: void CSplashDlg::OnPaint() { …
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
0
votes
0 answers

CImage : copying 8bit JPEGs gives a black image

The following code extract I am loading an 300DPI 8-bit JPEG and then trying to write it out again in a Fresh instance of a CImage also as a JPEG. But I end up with a black image with the correct dimensions. Can someone explain why that is? Ignore…
4GLGuy
  • 21
  • 3
0
votes
0 answers

CImage::Save file name formatting

In CImage::Save() function, how can I change the file name? I saw MSDN(https://msdn.microsoft.com/en-us/library/d06f3fhw(v=vs.120).aspx), but I cannot understand. Also, every example I found used a constant file name. Like…
Chanwoo Ahn
  • 334
  • 2
  • 13
-2
votes
1 answer

Cannot create array or vector of CPngImage class

I am using MFC Visual Studio 8 Version 9. I want to create an array or vector of CPngImage objects. If i declare the array to be global, its fine. If i try to add the array to one of my own classes in get the following error: afxwin.h(312) : error…