Plotting Raw pixels?

9 ビュー (過去 30 日間)
Umanga Bista
Umanga Bista 2011 年 12 月 11 日
Is it possible to plot raw pixels on computer screen using MATLAB?? I have to do a project for computer Graphics using various algorithms such as DDA, Bresenham etc for drawing shapes, animation etc. I thought MATLAB would be the best platform for this as the project requires many matrix operations. SO, I need to know if I could plot pixels in computer screen like i can in various libraries of C, C++???? Please Help ....

回答 (2 件)

Walter Roberson
Walter Roberson 2011 年 12 月 11 日
Sorry, there is no mechanism for this.
You can create an axis, set it invisible, put an image() object in the axes with size arranged to be 1:1 mapping on pixels. Then in the image object, keep updating the CData and AlphaData properties, with the AlphaData set to 0 in any location you have not "painted" and 1 in any location that you have "painted", and the CData set to anything in the locations you have not "painted" and set to the appropriate pixel values for the locations that you have "painted".
You will need to decide how you want to handle callbacks: for example, if a location is not painted, do you want to pass clicks on to the location "underneath", but if the location is painted, you want the click to be intercepted? Now, what about mouse-overs ? And do you want this covering the whole screen but without any obvious figure, with people able to open and close and resize the figures "underneath" the "raw pixels" ?

Jan
Jan 2011 年 12 月 11 日
What is a "raw" pixel?
You cannot access pixels on the monitor directly in Matlab. But you can display a matrix as image. So all actions, which can be applied to elements on a matrix can be displayed as graphics in a figure ("window"). I assume, you can solve your project in Matlab.

カテゴリ

Help Center および File ExchangeGraphics Objects についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by