2
$\begingroup$

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?

$\endgroup$
3
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.