[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C++ to Delphi

Posted on 2013-11-06
2
Medium Priority
?
490 Views
Last Modified: 2013-11-07
Hi,

Could you please convert to delphi:
public static BufferedImage glScreenshot() {
	glReadBuffer(GL_FRONT);
	int w = Display.getDisplayMode().getWidth();
	int h = Display.getDisplayMode().getHeight();
	int bpp = 4;
	ByteBuffer buffer = BufferUtils.createByteBuffer(w * h * bpp);
 
	glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
 
	BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
 
	for (int x = 0; x < w; x++) {
		for (int y = 0; y < h; y++) {
			int i = (x + (w * y)) * bpp;
			int r = buffer.get(i) & 0xFF;
			int g = buffer.get(i + 1) & 0xFF;
			int b = buffer.get(i + 2) & 0xFF;
			image.setRGB(x, h - (y + 1), (0xFF << 24) | (r << 16) | (g << 8) | b);
		}
	}
 
	return image;
}

Open in new window


Ty!
0
Comment
Question by:Júlio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 1500 total points
ID: 39628222
This might not help much, but: That's not valid C++ code. "public static" wouldn't compile.
0
 

Author Comment

by:Júlio
ID: 39630251
ok ty!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question