<p>As stated, the question is a bit generic. It all depends on what part you <em>want</em> to display in the 512x512 display. If you have a 1024x1024 frame buffer from some source and only want to display 1/4 of the information, by all means copy the first 512 elements from the first 512 lines. If you want to support <em>panning</em>, you'll start at a different index in a different line. If you want to support <em>scaling</em> (with or without filter), you'll use a bigger or smaller set of source pixels.</p>

<p>It also depends on the type of the buffer. If it's just raw bytes, your suggested approach is basically the only way to go, but if it's a DirectX/OpenGL texture, or part of some other graphics API (Windows Bitmap, graphics engine, etc), there are usually specialized approaches to get a rectangular subset of a buffer. </p>

CC BY-SA 3.0
2016-09-11T18:41:04.720Z
2016-09-11T18:41:04.720Z
Paul-Jan
<p>I am really new in computer graphic area.
Suppose I have 1024*1024 frame buffer, and I want to use it to control a 512*512 display. What shall I do?
In my opinion, I will only read the information in 512*512, such as from (0,0) to (0,511) then go to next line, (1,0) to (1,511)...
Is this an usual way to solve the problem?  </p>

<buffers>
Use big frame buffer to control a small display
zfb
# Use big frame buffer to control a small display

(Asked by: username_0 on 2016-09-11)

I am really new in computer graphic area.
Suppose I have 1024\*1024 frame buffer, and I want to use it to control a 512\*512 display. What shall I do?
In my opinion, I will only read the information in 512\*512, such as from (0,0) to (0,511) then go to next line, (1,0) to (1,511)...
Is this an usual way to solve the problem?

**Tags:** buffers


---

## 1 answers

### Answer by username_1 on 2016-09-11. Score: 3

As stated, the question is a bit generic. It all depends on what part you *want* to display in the 512x512 display. If you have a 1024x1024 frame buffer from some source and only want to display 1/4 of the information, by all means copy the first 512 elements from the first 512 lines. If you want to support *panning*, you'll start at a different index in a different line. If you want to support *scaling* (with or without filter), you'll use a bigger or smaller set of source pixels.

It also depends on the type of the buffer. If it's just raw bytes, your suggested approach is basically the only way to go, but if it's a DirectX/OpenGL texture, or part of some other graphics API (Windows Bitmap, graphics engine, etc), there are usually specialized approaches to get a rectangular subset of a buffer.


---

