完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
背景:MPLAB X IDE 4、XC32 V1.44、和声V2.04、PIC32 MZ2064 DAG176、NEWHAVEN 4.3“显示四线电阻触摸屏(ST722T2内部控制器)、内部DDR。黑白图像。我想从图像中删除白色,以便只有黑色部分出现在蓝色背景。在层级别启用透明度没有帮助。我试着在这里找到的APPyPrimulyMIX函数中更改值:这些掩码似乎不起作用。我想给你一些关于如何掩饰颜色的建议。我没有其他方法来创建更复杂的小部件。在我看来,唯一的方法是用一个类似温度计的刻痕来创建一个进度条,通过在进度条上播放一个图像并遮蔽白色部分,这样黑蜱就保留下来。
以上来自于百度翻译 以下为原文 Background: MPLAB X IDE 4.00, XC32 v1.44, HARMony v2.04, PIC32MZ2064DAG176, Newhaven 4.3" display with 4-wire resistive touch panel (ST7282T2 internal controller), internal DDR. I'm having a lot of trouble just working out a simple example: single layer with double buffering, blue background, and a black and white image. I want to remove the white from the image so that only the black parts appear over the blue background. Enabling transparency at the layer level doesn't help. I've tried changing values in the APP_Preload_Images function found here: imageSize = imageAssets->width * imageAssets->height * 4; for(j = 0; j < imageSize; ++j) { //Pre-paint the DDR with a specific color. //This is used by the GPU's masking function later //We do this purely to support the ability to turn on and off GPU at runtime *(uint32_t*)(currentAddress + j) = 0x00FFFF00; } GFX_Begin(); GFX_Set(GFXF_DRAW_TARGET, &pixelBuffer); GFXU_DrawImage(imageAssets, 0, 0, imageAssets->width, imageAssets->height, 0, 0, NULL, NULL); GFX_Set(GFXF_DRAW_TARGET, NULL); GFX_End(); imageAssets->mask = (GFX_Color)0x00FFFF00; Those masks don't seem to work. I would like some advice as to how you go about masking colors. I don't see any other way to create more complex widgets. The only way that I'm going to be able to create a progress bar with tick marks similar to a thermometer is, in my estimation, by playing an image over the progress bar and masking off the white parts so that the black ticks remain. |
|
相关推荐
4个回答
|
|
|
嗨,B祝福,你不能使用进度条窗口顶部的线条小部件来显示刻痕吗?这可能是一项工作,有更多的蜱,但你应该能够复制和粘贴小部件在MHGC。谢谢,Ed @ Microchip
以上来自于百度翻译 以下为原文 Hi bblessing, Can't you use the line widgets on top of the progress bar widget to show the tick marks? It may be a bit of work with more ticks, but you should be able to copy-and-paste widgets in MHGC. Thanks, Ed@Microchip |
|
|
|
|
|
这是真的,但非常乏味。此外,销售和管理类型倾向于一时兴起改变主意,我无法跟上这一点。我开始怀疑Segger emWin图形是不是该走的路。我相信Microchip在某些时候会达到一个非常有竞争力的水平,但是对于EMWIN来说,这是一个越来越高的价格,考虑到创建定制小部件所需的工时数,你看不到商业上的锐利。我再怎么强调你们花在这些事情上的时间我都不太重视。
以上来自于百度翻译 以下为原文 That is true, but it's extremely tedious. Moreover, sales and management types are prone to changing their minds on a whim, and I wouldn't be able to keep up with that. I'm beginning to wonder if Segger emWin graphics are the way to go. I'm sure Microchip will get Harmony to a very competitive level at some point, but that steep price tag for emWin is looking better and better given the number of man hours it takes to create custom widgets that in no way look as sharp what you see commercially. Thank you for your response, though! I can't emphasize enough how much I appreciate the hours you guys spend on these things. |
|
|
|
|
|
不,emWinis Free,如果你在PIC32上使用它的话。
以上来自于百度翻译 以下为原文 No, emWin is Free if you use it on a PIC32 ( At leat it was. |
|
|
|
|
|
如果你在CPU上做BLIT,它看起来是什么样的?我知道GPU是一种挑剔的面具颜色和选定的ROPS。我还记得,NANDA 2D二进制库有一个问题,掩饰是固定在2.04之前出去。我们最近还发现,当DAGPU在缓存大小不超过2的缓冲区时可能会出现问题。这里我所说的代码是用于掩蔽的(NAND2D包装器):这里是我刚才添加的功能函数,即预创建图像:创建复杂的小部件不是一个快速的P。摇滚乐。我认为编辑一个图像来获得你想要的外观和感觉要花的时间要少得多。为了让整个工具链认识到你的小部件,你需要创建两个Java插件,然后是实际的C实现。这整个流程的文档仍然是一个正在进行中的工作。
以上来自于百度翻译 以下为原文 What does it look like if you do the blit on the CPU? I know the GPU is kind of picky with the mask color and the selected ROPs. I also recall that the nano2d binary library had an issue with masking that was fixed just before 2.04 went out. We also recently discovered that the DA GPU can have issues when blitting buffers that aren't sized to a power of 2. Here's the code that I'm told is working for masking (nano2d wrapper): static GFX_Result drawBlit(const GFX_PixelBuffer* source, const GFX_Rect* srcRect, const GFX_Point* drawPoint, const GFX_DrawState* state) { n2d_buffer_t src_buffer, dest_buffer; GFX_Rect dest_rect; // the source address must reside in KSEG1 (cache coherent) memory // and the source buffer must be raw pixels as the the GPU doesn't // understand palettized blits // if this fails then fall back to software mode if(IS_KVA1(source->pixels) == GFX_FALSE || GFX_COLOR_MODE_IS_INDEX(source->mode) == GFX_TRUE || GFX_COLOR_MODE_IS_INDEX(state->target->mode) == GFX_TRUE || n2dFormats[source->mode] == -1 || n2dFormats[state->colorMode] == -1 || srcRect->width * srcRect->height < MAX_PROCESS_AREA) return cpuDrawBlit(source, srcRect, drawPoint, state); // craft source buffer descriptor src_buffer.width = source->size.width; src_buffer.height = source->size.height; src_buffer.stride = source->size.width * GFX_ColorInfo[source->mode].size; src_buffer.format = n2dFormats[source->mode]; src_buffer.orientation = N2D_0; src_buffer.handle = NULL; src_buffer.memory = source->pixels; src_buffer.gpu = KVA_TO_PA(source->pixels); // craft dest buffer descriptor dest_buffer.width = state->target->size.width; dest_buffer.height = state->target->size.height; dest_buffer.stride = state->target->size.width * GFX_ColorInfo[state->colorMode].size; dest_buffer.format = n2dFormats[state->target->mode]; dest_buffer.orientation = N2D_0; dest_buffer.handle = NULL; dest_buffer.memory = state->target->pixels; dest_buffer.gpu = KVA_TO_PA(state->target->pixels); dest_rect.x = drawPoint->x; dest_rect.y = drawPoint->y; dest_rect.width = srcRect->width; dest_rect.height = srcRect->height; if(state->maskEnable == GFX_TRUE) { n2d_color_t color = (n2d_color_t)state->maskValue; n2d_draw_state(N2D_TRANSPARENCY_SOURCE, color, 0xA, 0xC); } n2d_blit(&dest_buffer, (n2d_rectangle_t*)&dest_rect, &src_buffer, (n2d_rectangle_t*)srcRect, N2D_BLEND_NONE); if(state->maskEnable == GFX_TRUE) { n2d_draw_state(N2D_TRANSPARENCY_NONE, 0, 0xC, 0xC); } return GFX_SUCCESS; } And here's the utility function that I just added that prestages images: GFX_Result GFXU_PreprocessImage(GFXU_ImageAsset* img, uint32_t destAddress, GFX_ColorMode destMode, GFX_Bool padBuffer) { GFX_PixelBuffer buf; uint32_t width = img->width; uint32_t height = img->height; uint32_t p; GFX_Rect rect; if(img->header.dataLocation != 0) return 0; if(padBuffer == GFX_TRUE) { if(width && !(width & (width - 1)) == 0) { p = 1; while(width >= p) p <<= 1; width = p; } if(height && !(height & (height - 1)) == 0) { p = 1; while(height >= p) p <<= 1; height = p; } } GFX_PixelBufferCreate(width, height, destMode, (void*)destAddress, &buf); if((img->flags & GFXU_IMAGE_USE_MASK) > 0) { rect.x = 0; rect.y = 0; rect.width = buf.size.width; rect.height = buf.size.height; GFX_PixelBufferAreaFill(&buf, &rect, GFX_ColorConvert(img->colorMode, destMode, img->mask)); } else { memset(buf.pixels, 0, buf.buffer_length); } GFX_Set(GFXF_DRAW_TARGET, &buf); GFX_Begin(); GFXU_DrawImage(img, 0, 0, img->width, img->height, 0, 0, NULL, NULL); GFX_End(); GFX_Set(GFXF_DRAW_TARGET, NULL); img->header.dataAddress = (void*)destAddress; img->header.dataLocation = 0; img->header.dataSize = buf.buffer_length; img->bufferWidth = buf.size.width; img->bufferHeight = buf.size.height; img->format = GFXU_IMAGE_FORMAT_RAW; img->compType = GFXU_IMAGE_COMPRESSION_NONE; if((img->flags & GFXU_IMAGE_USE_MASK) > 0) img->mask = GFX_ColorConvert(img->colorMode, destMode, img->mask); else img->mask = 0; img->palette = NULL; img->colorMode = destMode; return GFX_SUCCESS; } Creating complex widgets is not a quick process. I would think it takes far less time to edit an image to get the exact look and feel you want. In order to get the entire toolchain to recognize your widget you'd need to create two java plugins and then the actual C implementation. Documention of this entire flow is still a work in progress. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1123浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 01:04 , Processed in 0.868409 second(s), Total 78, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3748