问题标签 [palette]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
253 浏览

installation - 自动编辑 LabVIEW 调色板集

我有一个要安装到 user.lib 文件夹的设备驱动程序,驱动程序中包含各种 .mnu 文件。安装驱动程序后,我需要去

工具->高级->编辑调色板集...

并从 mnu 文件创建一个新的子调色板。

有可能自动化吗?我宁愿用户可以简单地安装驱动程序,并且他们的调色板已经得到照顾。

0 投票
1 回答
2665 浏览

c# - 从 256 种颜色为 WritableBitmap 创建自定义调色板

我现在一直在寻找将近一个小时,但找不到答案。我目前正在开发一个程序,该程序以灰度或具有 256 种预定颜色的色阶显示自定义图像(使用 WritableBitmap)。

图像的输入将是一个字节数组(如果我将 PixelFormat 属性设置为 PixelFormats.Gray8,则可以正常工作),但由于我也需要自定义颜色比例,我想创建自定义比例(一个用于灰色,一个用于或更多颜色)。我认为我需要使用的是 PixelFormat.Indexed8 属性,但我根本不知道如何使用它以及如何创建自定义调色板,并且互联网对如何创建一个没有帮助。

0 投票
1 回答
730 浏览

java - 获取索引图像的数据(调色板索引)

如何访问索引图像(png8 或 gif)的图像数据(调色板索引数组)?

例子:

  • 图像调色板:{0xFF0000, 0x00FF00, 0x0000FF}
  • 图像数据:{0,1,1,0,1,2,2,2,0,1,0,2,0,1,1,0}

我需要的是:

0 投票
10 回答
42688 浏览

java - 空的 Netbeans 7 调色板?如何恢复它?

我在 Kubuntu 12.04 上使用 Netbeans 7。我像这样启动Netbeans:

Netbeans 和 Kubuntu 12.04 已知问题的原因。在我的项目中间,带有 Swing 组件的调色板刚刚消失了!

我只看到这样的东西:

在此处输入图像描述

如何恢复默认的 Netbeans 调色板?

我检查了 Ctrl+Shift+8 快捷方式,但没有结果 - 问题仍然相同。

**编辑:我不知道我做了什么,但现在我只看到空调色板:( : **

在此处输入图像描述

我也试过这个:

1) 我 cd'ed to /home/mazix/.netbeans/7.0/config/Windows2Local/Groups/commonpalette , ls'ed 并且只看到了这个:CommonPalette.wstcgrp

2) cd 到/home/mazix/.netbeans/7.0/config/Windows2Local/Components并看到了这个:

AnalyzerTopComponent.settings output.settings AnalyzeStackTopComponent.settings projectTabLogical_tc.settings breakpointsView.settings projectTab_tc.settings CallHierarchyTopComponent.settings properties_1.settings callstackView.settings properties.settings CommonPalette.settings refactoring-preview.settings ComponentInspector.settings
ReporterResultTopComponent.settings CssPreviewTC.settings
resultsView.settings debugging.settings
search-results.settings DeclarationTopComponent.settings
services.settings evaluator.settings
sessionsView.settings favorites.settings
sources.settings find-usages.settings
StyleBuilderTC.settings gsf-testrunner-results.settings
svnversioning.settings hgversioning.settings
synchronize.settings JavadocTopComponent.settings
TaskListTopComponent.settings localsView.settings
TerminalContainerTopComponent.settings MultiView-java#007Cform#007C_1.settings threadsView.settings MultiView-java#007Cform#007C_2 .settings versioning_output.settings MultiView-java#007Cform#007C_4.settings watchView.settings MultiView-java#007Cform#007C.settings Welcome.settings navigatorTC.settings

并没有看到任何 _hidden 文件:(

0 投票
1 回答
599 浏览

java - 用于一对多映射的挂毯组件

我对生物分类有相似的尺度。我正在寻找可以更快地将它们连接起来的挂毯组件。但是我仅限于挂毯 5.2.6。

我们已经在数据库中输入了 1000 条物种记录,我们希望将它们链接起来。我知道的唯一解决方案是在具有表格的表单内使用具有复杂代码的选择对象。我认为使用 GenericValueEncoder。

当然 selectobject 可以工作,但是与每个输入的物种的调色板或循环复选框(在我的版本中不可用)相比,它确实很慢。

但是主要问题仍然是我不了解调色板 java 代码。许多变量都有下划线,谁知道呢?

由于任何地方都没有评论,很难理解什么是什么,但我认为我需要做的是改变第 14 行。

使用 GenericValueEncoder 代替 EnumValueEncoder 和 GenericSelectModel 代替 EnumSelectModel。

如果有人设法用实体对象实现调色板,请告诉我该怎么做?

0 投票
1 回答
188 浏览

objective-c - 使调色板永久活跃/集中?

有没有一种简单的方法可以让我的应用程序的浮动工具面板永久激活?它们都与打开的文档相关,因此没有理由让它们在任何时间点都处于非活动状态。

0 投票
1 回答
1784 浏览

c++ - BitBlt 从剪贴板复制位图给出错误的颜色

我正在将剪贴板中的图像粘贴到我的程序中。位图放在背景 memDC 位图上,然后在绘制到屏幕之前与另一个 memDC 合成。背景位图是每像素 8 位。问题是 bitblt 将黑色(0x00000000)变成了几乎黑色(0x00010101)。如果我将相同的东西粘贴到 MSPaint 中,我会得到黑色。如果我从 MSPaint 复制黑色,我会得到几乎黑色。(其他颜色也被破坏)。如果我将背景位图更改为 32bpp,我会得到正确的颜色,但目前这不是一个选项。

以下是一些演示该问题的代码:

使用 GetPixel() 和 GetNearestColor(),似乎我应该得到我正在寻找的结果,但我没有。我想我错过了某种调色板操作?

更新

我真正遇到问题的部分,也许我误解了这些 API 的重点,是我可以查询像素颜色,然后询问上下文它将使用什么颜色,它会返回正确的颜色(黑色),而不是 BitBlt 生成的几乎黑色。

其他程序似乎没有在剪贴板上放置调色板——可能是因为它们放置了不需要调色板的 32bpp 位图?根据MSDN 的剪贴板翻译表查看可用的内容,他们甚至没有像我所知的那样做 DIB

0 投票
2 回答
720 浏览

2d - 使用 Direct3D 9 快速调色的屏幕 blit

游戏使用软件渲染在内存中绘制全屏调色板(8 位)图像。

使用 Direct3D 将该图像放在屏幕上的最快方法是什么?

目前我在软件中将调色图像转换为 RGB,然后将其放在D3DUSAGE_DYNAMIC纹理上(用 锁定D3DLOCK_DISCARD)。

有更快的方法吗?例如,使用着色器执行调色?

相关问题:

0 投票
1 回答
191 浏览

raphael - RaphaelJS 调色板行为

如何在 raphaelJS 中进行调色板行为(将元素从“调色板”拖放到“画布”)?

0 投票
1 回答
1641 浏览

opengl - OpenGL - Animate/cycle/rotate palette

I was trying to create a OpenGL version of an old plasma 8bit effect animation in DOS but I am stuck. Since almost every OpenGL program has included something to generate a palette for Win32 I thought it would not be that hard to apply palette animation on my old program.

My purpose is to generate a texture with color indices that does not change and a palette that is rotating. After digging into the web this weekend I am still not able to fix it. I cannot even display a texture with one color index so in that stage something is wrong (if it would work I can create the palette cycling mechanism).

I can force into palette mode by using PFD_TYPE_COLORINDEX and draw some random pixels using glIndexi. I read that glDrawPixels and glReadPixels are slow and the latter is not that accurate when getting pixels back from the framebuffer (due to inaccurate positioning as a result from rounding errors or something).

I tried the GL_COLOR_INDEX keyword. I also tried: glPixelTransferi(GL_MAP_COLOR, true); glPixelMapfv( GL_PIXEL_MAP_I_TO_R, ...); glTexImage2D... Some of the code I tried so far (latest changes):

init part:

update/draw:

Or should I use glColorTableEXT in combination with GL_COLOR_INDEX8_EXT? I read somewhere that textured palettes are not supported? I found a link which mentions Paletted Texture Extension: http://www.cs.rit.edu/~ncs/Courses/570/UserGuide/OpenGLonWin-20.html

This is what I want (but then in OpenGL):

http://www.codeforge.com/read/174459/PalAnimDemo.h__html

I am not looking for ES/Shader implementations (I am just a beginner ;)) and DirectDraw might be easier I think but I want to try OpenGL.