Skip to content

how to get the RGBA imge data ,i do this,but get nothing #189

Description

@cyberdstar

double x[] = { 0, 0.2, 0.4, 0.6, 0.8, 1.0 };
double y[] = { 0.3, 0.5, 0.4, 0.2, 0.6, 0.7 };
/* Draw something into the memory using GR / // 'RGBA'
// gr_openws(0, 0, 100);
char filename[64];
sprintf_s(filename, "!%dx%d@%p.mem", width, height, data);
// gr_setlinewidth(1);
gr_beginprint(filename);
gr_polyline(6, x, y);
gr_endprint();
std::vector vvc;
for (int j = 0; j < height; j++)
{
unsigned char
pdata = &data[width * 4 * j];
for (uint64_t i = 0; i < (width * 4); i = i + 4)
{
vvc.push_back({pdata[i + 3],pdata[i + 0],pdata[i + 1] ,pdata[i + 2] });
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions