Win32 中菜单项使用bitmap 为什么显示确是黑色块

Win32 中菜单项使用bitmap 为什么显示确是黑色块

###代码如下:

#include<windows.h>
#include "resource.h"

LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

void AddHelpToSys(HINSTANCE ,HWND);
HBITMAP StretchBitmap(HBITMAP);
HMENU CreateMyMenu(HINSTANCE);
HBITMAP GetBitmapFont(int);

int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
{
    static TCHAR szAppName[]= TEXT("GrafMenu--demo");
    MSG msg;
    HWND hwnd;
    WNDCLASS wndclass;

    wndclass.cbClsExtra = 0;
    wndclass.cbWndExtra = 0;
    wndclass.hbrBackground = GetStockObject(WHITE_BRUSH);
    wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
    wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hInstance = hInstance;
    wndclass.lpfnWndProc = WndProc;
    wndclass.lpszClassName = szAppName;
    wndclass.lpszMenuName = NULL;
    wndclass.style = CS_VREDRAW | CS_HREDRAW;

    if (!RegisterClass(&wndclass))
    {
        MessageBox(NULL, TEXT("registerclass fail!"), szAppName, MB_ICONERROR);
        return 0;
    }

    hwnd = CreateWindow(szAppName, szAppName, WS_OVERLAPPEDWINDOW,
        CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
    ShowWindow(hwnd, nShowCmd);
    UpdateWindow(hwnd);

    while (GetMessage(&msg,NULL,0,0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    HINSTANCE hinst;
    static int iCurrentFont= ID_FONT_COUR;
    HMENU hMenu;
    switch (message)
    {
    case WM_CREATE:

        AddHelpToSys(((LPCREATESTRUCT)lParam)->hInstance, hwnd);
        hMenu = CreateMyMenu(((LPCREATESTRUCT)lParam)->hInstance);

        SetMenu(hwnd, hMenu);

        return 0;
    case WM_CLOSE:
        PostQuitMessage(0);
        return 0;
    }

    return DefWindowProc(hwnd, message, wParam, lParam);
}

void AddHelpToSys(HINSTANCE hInstance,HWND hwnd)
{
    HMENU hMenu;
    HBITMAP hBitmap;
    hMenu=GetSystemMenu(hwnd, FALSE);
    hBitmap=LoadBitmap(hInstance, TEXT("bighelp"));

    AppendMenu(hMenu, MF_SEPARATOR, 0, 0);

    AppendMenu(hMenu, MF_BITMAP, ID_HELP, (PTSTR)(LONG)hBitmap);
}

HBITMAP StretchBitmap(HBITMAP hBitmap1)
{
    BITMAP bm1,bm2;
    HBITMAP hBitmap2;
    int cxChar, cyChar;
    HDC hdc, hdcMem1,hdcMem2;

    // ´´½¨É豸»·¾³
    hdc = CreateIC(TEXT("DISPLAY"), 0, 0, 0);
    hdcMem1 = CreateCompatibleDC(hdc);
    hdcMem2 = CreateCompatibleDC(hdc);
    DeleteDC(hdc);
    //»ñµÃ¶Ô»°¿ò»ù±¾µ¥Ôª£¬in pixel
    cxChar = LOWORD(GetDialogBaseUnits());
    cyChar = HIWORD(GetDialogBaseUnits());

    //»ñµÃhbitmap1µÄÊý¾Ý
    GetObject(hBitmap1, sizeof(BITMAP), &bm1);
    bm2 = bm1;
    //ÉèÖÃbm2µÄ´óС
    bm2.bmWidth = (cxChar*bm2.bmWidth) / 4;
    bm2.bmHeight=(cyChar*bm2.bmHeight) / 8;
    bm2.bmWidthBytes = ((bm2.bmWidth + 15) / 16) * 2;
    //´´½¨hbitmap2
    hBitmap2=CreateBitmapIndirect(&bm2);
    //¼ÓÔØbitmapµ½É豸»·¾³
    SelectObject(hdcMem1, hBitmap1);
    SelectObject(hdc, hBitmap2);

    StretchBlt(hdcMem2, 0, 0, bm2.bmWidth, bm2.bmHeight, hdcMem1, 0, 0, bm1.bmWidth, bm1.bmHeight, SRCCOPY);
    DeleteObject(hBitmap1);
    DeleteDC(hdcMem1);
    DeleteDC(hdcMem2);
    return hBitmap2;
}

HMENU CreateMyMenu(HINSTANCE hinst)
{
    HBITMAP hBitmap;
    HMENU hMenu, hMenuPopup;
    int i;
    //´´½¨Ò»¸ö¿ÕµÄMenu
    hMenu = CreateMenu();

    hMenuPopup = LoadMenu(hinst, TEXT("MenuFile"));
    hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("FILE")));
    AppendMenu(hMenu, MF_BITMAP | MF_POPUP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap);
    hMenuPopup = LoadMenu(hinst, TEXT("MenuEdit"));
    hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("EDIT")));
    AppendMenu(hMenu, MF_POPUP | MF_BITMAP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap);

    hMenuPopup = CreateMenu();
    for (i=0;i<3;i++)
    {
        hBitmap = GetBitmapFont(i);
        AppendMenu(hMenuPopup, MF_BITMAP, ID_FONT_COUR + i, (PTSTR)(LONG)hBitmap);
    }
    hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("FONT")));
    AppendMenu(hMenu, MF_BITMAP | MF_POPUP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap);
    return hMenu;

}


HBITMAP GetBitmapFont(int i)
{
    static TCHAR *szFaceName[3] = { TEXT("Courier New"),TEXT("Arial"),TEXT("Times New Roman") };

    HBITMAP hBitmap;
    HDC hdc, hdcMem;
    HFONT hFont;
    SIZE size;
    TEXTMETRIC tm;

    hdc = CreateIC(TEXT("DISPLAY"), 0, 0, 0);
    GetTextMetrics(hdc, &tm);

    hdcMem = CreateCompatibleDC(hdc);
    hFont = CreateFont(2 * tm.tmHeight, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, szFaceName[i]);

    hFont = (HFONT)SelectObject(hdcMem, hFont);
    GetTextExtentPoint32(hdcMem, szFaceName[i], lstrlen(szFaceName[i]), &size);
    hBitmap = CreateBitmap(size.cx, size.cy, 1, 1, NULL);
    SelectObject(hdcMem, hBitmap);

    TextOut(hdcMem, 0, 0, szFaceName[i], lstrlen(szFaceName[i]));
    DeleteObject(SelectObject(hdcMem, hFont));
    DeleteDC(hdcMem);
    DeleteDC(hdc);
    return hBitmap;
}






###在CreateMyMenu函数中,加载看起来都正常,但是运行起来,都是黑色块状......

如图

c++
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Win32 menu 项使用bitmap为什么显示确实黑色块?
``` void AddHelpToSys(HINSTANCE hInstance,HWND hwnd) { HMENU hMenu; HBITMAP hBitmap; hMenu=GetSystemMenu(hwnd, FALSE); hBitmap=LoadBitmap(hInstance, TEXT("bighelp")); AppendMenu(hMenu, MF_SEPARATOR, 0, 0); AppendMenu(hMenu, MF_BITMAP, ID_HELP, (PTSTR)(LONG)hBitmap); } HBITMAP StretchBitmap(HBITMAP hBitmap1) { BITMAP bm1,bm2; HBITMAP hBitmap2; int cxChar, cyChar; HDC hdc, hdcMem1,hdcMem2; // ´´½¨É豸»·¾³ hdc = CreateIC(TEXT("DISPLAY"), 0, 0, 0); hdcMem1 = CreateCompatibleDC(hdc); hdcMem2 = CreateCompatibleDC(hdc); DeleteDC(hdc); //»ñµÃ¶Ô»°¿ò»ù±¾µ¥Ôª£¬in pixel cxChar = LOWORD(GetDialogBaseUnits()); cyChar = HIWORD(GetDialogBaseUnits()); //»ñµÃhbitmap1µÄÊý¾Ý GetObject(hBitmap1, sizeof(BITMAP), &bm1); bm2 = bm1; //ÉèÖÃbm2µÄ´óС bm2.bmWidth = (cxChar*bm2.bmWidth) / 4; bm2.bmHeight=(cyChar*bm2.bmHeight) / 8; bm2.bmWidthBytes = ((bm2.bmWidth + 15) / 16) * 2; //´´½¨hbitmap2 hBitmap2=CreateBitmapIndirect(&bm2); //¼ÓÔØbitmapµ½É豸»·¾³ SelectObject(hdcMem1, hBitmap1); SelectObject(hdc, hBitmap2); StretchBlt(hdcMem2, 0, 0, bm2.bmWidth, bm2.bmHeight, hdcMem1, 0, 0, bm1.bmWidth, bm1.bmHeight, SRCCOPY); DeleteObject(hBitmap1); DeleteDC(hdcMem1); DeleteDC(hdcMem2); return hBitmap2; } HMENU CreateMyMenu(HINSTANCE hinst) { HBITMAP hBitmap; HMENU hMenu, hMenuPopup; int i; //´´½¨Ò»¸ö¿ÕµÄMenu hMenu = CreateMenu(); hMenuPopup = LoadMenu(hinst, TEXT("MenuFile")); hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("FILE"))); AppendMenu(hMenu, MF_BITMAP | MF_POPUP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap); hMenuPopup = LoadMenu(hinst, TEXT("MenuEdit")); hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("EDIT"))); AppendMenu(hMenu, MF_POPUP | MF_BITMAP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap); hMenuPopup = CreateMenu(); for (i=0;i<3;i++) { hBitmap = GetBitmapFont(i); AppendMenu(hMenuPopup, MF_BITMAP, ID_FONT_COUR + i, (PTSTR)(LONG)hBitmap); } hBitmap = StretchBitmap(LoadBitmap(hinst, TEXT("FONT"))); AppendMenu(hMenu, MF_BITMAP | MF_POPUP, (int)hMenuPopup, (PTSTR)(LONG)hBitmap); return hMenu; } HBITMAP GetBitmapFont(int i) { static TCHAR *szFaceName[3] = { TEXT("Courier New"),TEXT("Arial"),TEXT("Times New Roman") }; HBITMAP hBitmap; HDC hdc, hdcMem; HFONT hFont; SIZE size; TEXTMETRIC tm; hdc = CreateIC(TEXT("DISPLAY"), 0, 0, 0); GetTextMetrics(hdc, &tm); hdcMem = CreateCompatibleDC(hdc); hFont = CreateFont(2 * tm.tmHeight, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, szFaceName[i]); hFont = (HFONT)SelectObject(hdcMem, hFont); GetTextExtentPoint32(hdcMem, szFaceName[i], lstrlen(szFaceName[i]), &size); hBitmap = CreateBitmap(size.cx, size.cy, 1, 1, NULL); SelectObject(hdcMem, hBitmap); TextOut(hdcMem, 0, 0, szFaceName[i], lstrlen(szFaceName[i])); DeleteObject(SelectObject(hdcMem, hFont)); DeleteDC(hdcMem); DeleteDC(hdc); return hBitmap; } ``` 在CreateMyMenu函数中,加载bitmap 最后显示确实黑色块为什么?
我使用画布把文字和图片合成一张新图 在分享出去 图片看起来非常模糊
公司一个项目需要把文字和图片 二维码各种合成一张新图 但是分享出去后图片看起来比较模糊求大佬指导![图片说明](https://img-ask.csdn.net/upload/202001/15/1579074867_663704.jpg /** * 分享时的图标 */ try { Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.image_act_back); int width = 480;//画布大小 int height = 853;// // mBitmap =Bitmap.createBitmap(width,height, Bitmap.Config.ARGB_8888); mBitmap =BitmapUtil.getBitmap(bitmap,width,height); canvas = new Canvas(mBitmap); int x = 30; int y = 15; //合成淘宝 (判断是淘宝还是拼多多) Bitmap bitmap_tb = null; if (shopType.equals("1")){ //淘宝 bitmap_tb = BitmapFactory.decodeResource(getResources(), R.mipmap.qbs_tb); }else if (shopType.equals("3")){ bitmap_tb = BitmapFactory.decodeResource(getResources(), R.mipmap.qbs_pdd_order1); }else if (shopType.equals("4")){ bitmap_tb = BitmapFactory.decodeResource(getResources(), R.mipmap.qbs_wph); } Bitmap bitmap2 = BitmapUtil.fitBitmap(bitmap_tb,x); canvas.drawBitmap(bitmap2,x,y,mPicturePaint2); //商品标题 TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(18); TextPaint1.setColor(getResources().getColor(R.color.black)); String content1 = shopTitle.length()>22? shopTitle.substring(0,22):shopTitle; int top2 = 30; canvas.drawText(content1,x+40,x,TextPaint1); //第二行标题 String content2; if (shopTitle.length()>34){ content2 = shopTitle.substring(22,35)+"...."; }else { content2 = shopTitle.length()>22? shopTitle.substring(23):shopTitle; } TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(18); TextPaint1.setColor(getResources().getColor(R.color.black)); top2 = top2+30; canvas.drawText(content2,x,top2,TextPaint1); //券后价格 String content6 = "券后价:"; TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(24); TextPaint1.setColor(getResources().getColor(R.color.detail_prise)); top2 = top2+40; canvas.drawText(content6,x,top2,TextPaint1); //券后价金额 TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(30); TextPaint1.setColor(getResources().getColor(R.color.detail_prise)); String content8 = "¥"+price_after_coupons; canvas.drawText(content8,x+80,top2,TextPaint1); // //券背景 // Bitmap bitmap_q = BitmapFactory.decodeResource(getResources(), R.mipmap.qbs_q_back); // Bitmap bitmap_back = BitmapUtil.fitBitmap(bitmap_q,110); // canvas.drawBitmap(bitmap_back,330,top2-15,mPicturePaint2); if (!price_coupons.equals("")){ //券金额 TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(16); TextPaint1.setColor(getResources().getColor(R.color.detail_prise));//detail_prise String content4 = "券¥"; canvas.drawText(content4,340,top2,TextPaint1); TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(22); TextPaint1.setColor(getResources().getColor(R.color.detail_prise)); String content5 = price_coupons+""; canvas.drawText(content5,340+30,top2,TextPaint1); } //原价 TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(16); TextPaint1.setColor(getResources().getColor(R.color.theme_black2)); CharSequence content3 = "原价¥"; top2 = top2+40; canvas.drawText(content3,0,content3.length(),x,top2,TextPaint1); //原价金额 TextPaint1.setAntiAlias(true); TextPaint1.setTextSize(26); TextPaint1.setColor(getResources().getColor(R.color.theme_black2)); CharSequence content7 = price; canvas.drawText(content7,0,content7.length(),x+60,top2,TextPaint1); //商品图 // int logo = 0; // Logger.e(TAG,"图片宽"+resource.getWidth()+"图片高"+resource.getHeight()); Bitmap bitmap_shop = BitmapUtil.fitBitmap(resource,width-50); Logger.e(TAG,"图片宽"+bitmap_shop.getWidth()+"图片高"+bitmap_shop.getHeight()); top2 = top2+20; // canvas = new Canvas(mBitmap); // logo = top2; canvas.drawBitmap(bitmap_shop,x,top2,mPicturePaint2); //公司logo Bitmap bitmap_logo = BitmapFactory.decodeResource(getResources(), R.mipmap.ht_creat_logo);//qbs_creat_logo icon_yfg Bitmap bitmap_log = BitmapUtil.fitBitmap(bitmap_logo,150); canvas.drawBitmap(bitmap_log,150,width+top2,mPicturePaint2); //二维码合成 Bitmap Zxing = ZxingUtils.createQRCode(Wx_Url,300); int width1 = Zxing.getWidth(); int height1 = Zxing.getHeight(); Matrix matrix = new Matrix(); matrix.postScale(0.35f,0.35f); Bitmap bitmap1 = Bitmap.createBitmap(Zxing, 0, 0, width1, height1, matrix, true); Logger.e("二维码宽","二维码宽"+bitmap1.getWidth()); canvas.drawBitmap(bitmap1,353,width-20+top2,mPicturePaint1); canvas.save(); canvas.restore(); creat_pic.setImageBitmap(mBitmap); ``` ```
Typesetting 文字输出的实现方式
Problem Description Modern fonts are generally of two varieties: outline fonts, whose glyphs (the individual character shapes) are specified mathematically as a set of curves, and bitmap fonts, whose glyphs are specified as patterns of pixels. Fonts may also include embedded information such as kerning pairs (adjusting the spacing between certain pairs of glyphs, such as "AW", so that they appear spaced correctly), tracking hints (for managing inter-glyph spacing), antialiasing hints (smoothing of pixellated edges), and much more. To be sure, modern fonts are more than a simple collection of shapes, and displaying them properly is a common programming challenge. For this problem we will concern ourselves with bitmapped fonts and a simple form of typesetting called glyph packing. Essentially, the idea is to pack the glyphs as tightly as possible while maintaining at least one horizontal pixel of separation between glyphs. For example, consider the glyphs shown to the left below for the Roman characters "P" and "J". The figure to the right shows them after glyph packing. Note that they are as close as possible without touching horizontally. Here's another example. In this case, notice that the final glyph cannot be packed at all. After packing, pixels from distinct glyphs may be adjacent diagonally or vertically, but not horizontally. The following example shows that pixels may be adjacent diagonally. The "Love" test case in the example input section shows that they may be adjacent vertically. Glyph packing has the nice property that it's easy to build "fancy" glyphs into the font so that glyph packing creates special effects with no extra work. Look at the "Toy" example below. The same simple packing process has been applied to these glyphs as to the ones above, but the result is more dramatic: Glyph packing has a few caveats, however, one of which we must concern ourselves with for this problem. Consider the example on the left below where a glyph for a hyphen is followed by a glyph for an underscore. Based on our one horizontal pixel of separation rule, how would this pack? Clearly something more is needed, and that something more is hinting within the glyphs themselves. Recall that in actual practice, fonts contain kerning pairs, tracking hints, etc. For our purposes, our hinting will be limited to "invisible" pixels that count as a pixel for the purpose of packing, but not for display. The center image below represents invisible pixels as open dots instead of closed dots. Now the two glyphs can be properly packed, resulting in the output shown on the right. Now for the formal definition of a proper packing: (1) Glyphs are packed as close as possible without allowing any pixels from different glyphs to be immediately horizontally adjacent; (2) Given two glyphs, they may not be packed in such a way that any pixel of the leftmost glyph at a given height ends up positioned to the right of any pixel at the same height in the rightmost glyph. Condition (2) above is easily understood by visualizing two glyphs sitting side by side, separated by a small space. If you "squeeze" them together, condition (2) says that their pixels are not allowed to "pass through" one another. Consider the example to the left below. The center image is not the proper packing, because it violates condition (2) of the formal definition. The image on the right is the proper packing of these glyphs. Input The input for this problem is sets of glyphs to be packed. In a given test case, all glyphs are the same height, and an integer, N, on the first line of the test case specifies this height. The next N lines contain the glyphs to be packed. Empty pixels in a glyph are represented by a dot '.' character. Non-empty pixels are represented by a hash mark '#' for visible pixels, and a zero '0' for invisible pixels. Glyphs are separated by a single column of space characters. The input will always consist of more than one glyph, at least one of which will always contain at least one visible pixel. A glyph will always have at least one non-empty pixel in its leftmost and rightmost column, and every glyph will have at least one non-empty pixel at the same height as at least one other glyph in the input. The minimum dimension of a glyph is 1 × 1, the maximum dimension is 20 × 20, and the maximum number of glyphs that will appear in any test case is 20. Test cases continue until a value of zero is specified for N. Output For each test case, first output the number of that test case (starting with 1) on a line by itself. Then output the proper packing of the input glyphs, using the dot '.' character for empty pixels and for invisible pixels, and the hash mark '#' character for visible pixels. Omit leading and trailing empty columns (columns with no visible pixels) so that both the leftmost and rightmost output columns contain at least one visible pixel. Sample Input 8 ###. ...# #..# ...# #..# ...# ###. ...# #... ...# #... ...# #... #..# #... #### 8 ############# .... ............. ..#.......... .... ............. ..#.......... .##. .........#..# ..#.......... #..# .........#..# ..#.......... #..# .........#..# ..#.......... .##. ..........### ............. .... ............# ............. .... ############. 8 ############# ............. ..#.......... ............. ..#.......... .........#..# ..#.......... .........#..# ..#.......... .........#..# ..#.......... ..........### ............. ............# ............. ############. 5 0..0 0..0 0..0 0..0 #### 0..0 0..0 0..0 0..0 #### 5 #.... .###. #.... #...# #...# #...# #...# ....# .###. ....# 3 ### 0.0 ### #.# 0.0 #.# ### 0.0 ### 3 0.0 ### 0.0 0.0 #.# 0.0 0.0 ### 0.0 8 #.... .... ..... .... #.... .... ..... .... #.... .##. #...# .##. #.... #..# .#.#. #..# #.... #..# .#.#. #..# #.... #..# .#.#. ###. #.... .##. ..#.. #... ##### .... ..#.. .### 0 Sample Output 1 ###..# #..#.# #..#.# ###..# #....# #....# #.#..# #.#### 2 ############# ..#.......... ..#..##..#..# ..#.#..#.#..# ..#.#..#.#..# ..#..##...### ............# ############. 3 .....############# .......#.......... .......#.#..#..... .......#.#..#..... .......#.#..#..... .......#..###..... ............#..... ############...... 4 ......... ......... ####..... ......... .....#### 5 #......###. #.....#...# #...#.#...# #...#.....# .###......# 6 ###.....### #.#.....#.# ###.....### 7 ### #.# ### 8 #.............. #.............. #..##.#...#.##. #.#..#.#.#.#..# #.#..#.#.#.#..# #.#..#.#.#.###. #..##...#..#... #####...#...###
linux上导入1个G的dmp,导出来只有不到5M
在centos7的oracle上创建新用户后,导入了一个1G多的dmp文件,再将这个用户导出时只有几个M ``` [oracle@oracle-test ~]$ export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK[oracle@oracle-test ~]$ exp isc/isc@192.168.157.132:1521/orcl file=/disk3/expisc/tisc.dmp owner=isc Export: Release 11.2.0.1.0 - Production on Tue Jan 14 12:36:23 2020 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set About to export specified users ... . exporting pre-schema procedural objects and actions . exporting foreign function library names for user ISC . exporting PUBLIC type synonyms . exporting private type synonyms . exporting object type definitions for user ISC About to export ISC's objects ... . exporting database links . exporting sequence numbers . exporting cluster definitions . about to export ISC's tables via Conventional Path ... . . exporting table HR_ORG_BASIC_INFO 0 rows exported . . exporting table HR_ORG_BASIC_INFO_TEMP 0 rows exported . . exporting table HR_POST_BASIC_INFO 0 rows exported . . exporting table HR_USER_BASIC_INFO 0 rows exported . . exporting table ISC_ACCOUNT 4 rows exported . . exporting table ISC_ACCOUNT_EXT_PROP 0 rows exported . . exporting table ISC_ACTOR_ROLE_R 4362 rows exported . . exporting table ISC_APPLICATION 3 rows exported . . exporting table ISC_APPSHOW_CONF 1 rows exported . . exporting table ISC_APP_CODE_CONF 0 rows exported . . exporting table ISC_APP_CODE_FIELD_EXT 0 rows exported . . exporting table ISC_APP_DATARESOUCE_R 3 rows exported . . exporting table ISC_AUTHORIZE_COMMIT 0 rows exported . . exporting table ISC_BASEORG 8801 rows exported . . exporting table ISC_BASEORG_EXT_PROP 0 rows exported . . exporting table ISC_BASEORG_SPORG_UNIT_R 0 rows exported . . exporting table ISC_COMMON_CONST 196 rows exported . . exporting table ISC_DEPLOY 2 rows exported . . exporting table ISC_DIM 0 rows exported . . exporting table ISC_DUTY 0 rows exported . . exporting table ISC_LOGIN_LOCK 36 rows exported . . exporting table ISC_MAIL_CONF 0 rows exported . . exporting table ISC_MAIL_TEMPLATE_CONF 0 rows exported . . exporting table ISC_MDMORG_SPORG_UNIT_R 0 rows exported . . exporting table ISC_MDM_ORG 0 rows exported . . exporting table ISC_MSG_RESOURCE 0 rows exported . . exporting table ISC_NODE 3 rows exported . . exporting table ISC_NODE_DEPLOY_R 2 rows exported . . exporting table ISC_ORG_ATTRIBUTE 11 rows exported . . exporting table ISC_ORG_SYS_DIM_R 0 rows exported . . exporting table ISC_ORG_UNIT_DIM_R 0 rows exported . . exporting table ISC_RESOURCE 642 rows exported . . exporting table ISC_RESOURCE_EXT_PROPERTY 172 rows exported . . exporting table ISC_RESOURCE_EXT_PROPERTY_ETL 0 rows exported . . exporting table ISC_RESOURCE_TYPE 15 rows exported . . exporting table ISC_RESOURC_TYPE_APPLICATION_R 0 rows exported . . exporting table ISC_RES_EXT_VALUE 3230 rows exported . . exporting table ISC_RES_RES_R 638 rows exported . . exporting table ISC_ROLEGROUP 8 rows exported . . exporting table ISC_ROLE_LAYER_BY_ORG 67 rows exported . . exporting table ISC_ROLE_RES_R 2947 rows exported . . exporting table ISC_SECURE_CONF 2 rows exported . . exporting table ISC_SPECIALORG_UNIT 9 rows exported . . exporting table ISC_SPECIALORG_UNIT_BAK 0 rows exported . . exporting table ISC_SPORG_EXTPROP 0 rows exported . . exporting table ISC_SPORG_EXTPROPVAL 0 rows exported . . exporting table ISC_SPORG_EXTPROP_ATTR_R 0 rows exported . . exporting table ISC_SPROLE 81 rows exported . . exporting table ISC_SPROLE_EXT 0 rows exported . . exporting table ISC_SPROLE_EXT_VALUE 0 rows exported . . exporting table ISC_SPROLE_R 0 rows exported . . exporting table ISC_SP_DOMAIN 3 rows exported . . exporting table ISC_SP_DOMAIN_CODE_RELATION 15 rows exported . . exporting table ISC_SP_ORG_SYSTEM 3 rows exported . . exporting table ISC_STRATEGY_BASEORG_R 0 rows exported . . exporting table ISC_STRATEGY_CONF 0 rows exported . . exporting table ISC_STRATEGY_SESSION 0 rows exported . . exporting table ISC_STRATEGY_USER 0 rows exported . . exporting table ISC_SYNC_LOG 0 rows exported . . exporting table ISC_SYNC_PROCESS 0 rows exported . . exporting table ISC_SYSTEM_START_CONFIG 1 rows exported . . exporting table ISC_TEMP_ACTOR_ROLE_TBL 0 rows exported . . exporting table ISC_TEMP_USER 0 rows exported . . exporting table ISC_TEMP_USER_TBL 0 rows exported . . exporting table ISC_UNIT 27 rows exported . . exporting table ISC_USER 1947 rows exported . . exporting table ISC_USER_CFCA_CONN 0 rows exported . . exporting table ISC_USER_DUTY 0 rows exported . . exporting table ISC_USER_EXT 0 rows exported . . exporting table ISC_USER_EXT_PROPERTY 0 rows exported . . exporting table ISC_USER_EXT_PROP_ERP 0 rows exported . . exporting table ISC_USER_EXT_PROP_VALUE_ERP 0 rows exported . . exporting table ISC_USER_PASSWORDUSEFULDAY 54 rows exported . . exporting table ISC_USER_PASSWORD_REPETITIONS 20 rows exported . . exporting table ISC_USER_SPORG 1557 rows exported . . exporting table ISC_WO_ACCOUNTAPPLY 0 rows exported . . exporting table ISC_WO_ACCOUNT_CHANGE 0 rows exported . . exporting table ISC_WO_APPCONF_CHANGE 0 rows exported . . exporting table ISC_WO_APPROVAL_COMMENTS 0 rows exported . . exporting table ISC_WO_APP_REGISTER 0 rows exported . . exporting table ISC_WO_ORDER 0 rows exported . . exporting table ISC_WO_ROLELIST 0 rows exported . . exporting table ISC_WO_ROLES 0 rows exported . . exporting table OPERATE_OBJ 81 rows exported . . exporting table OPERATE_TYPE 419 rows exported . . exporting table RESOURCE_DEFAULT_PROPERTY 43 rows exported . . exporting table SAS_REPORT_FILES_LOG 0 rows exported . . exporting table SAS_STANDARD_DB_LOG_201301 0 rows exported . . exporting table SAS_STANDARD_LOG_TYPE 5 rows exported . . exporting table SAS_STATISTICAL_RULES 0 rows exported . . exporting table SAS_STATISTICS_DAY_LOGIN_COUNT 44 rows exported . . exporting table SAS_STATISTICS_DAY_LOGIN_USERS 53 rows exported . . exporting table SAS_STATISTICS_SP_VISIT_COUNT 1 rows exported . . exporting table USER_VERIFY 6 rows exported . exporting synonyms . exporting views . exporting stored procedures . exporting operators . exporting referential integrity constraints . exporting triggers . exporting indextypes . exporting bitmap, functional and extensible indexes . exporting posttables actions . exporting materialized views . exporting snapshot logs . exporting job queues . exporting refresh groups and children . exporting dimensions . exporting post-schema procedural objects and actions . exporting statistics Export terminated successfully without warnings. ``` 请问为什么会这样子?
Contour Tracing 反跟踪问题
Problem Description In computer vision, objects of interest are often represented as regions of 1's in a binary image (bitmap). An important task in the identification of objects is to trace the contour (also called border and boundary) in an object. We assume that the bitmap does not contain any 1's on the borders. To trace the contour of a single object, we can use a procedure known as the Moore boundary tracking algorithm as follows: Scan from the top row to the bottom row, from left to right in each row, until an object pixel is found. Call this object pixel b0, and its west background neighbour c0. Examine the 8 neighbours of b0, starting at c0 and proceeding in clockwise direction. Let b1 denote the first neighbour object pixel encountered, and c1 be the background neighbour immediately preceeding b1. Store the locations of b0 and b1, and append b0 and b1 to the contour. Let b = b1 and c = c1 Let the 8 neighbours of b, starting at c and proceeding in a clockwise direction, be denoted as n1, n2, ..., n8. Find the first object neighbour nk in this sequence. Let b = nk, c = n(k-1). Append b to the contour. Repeat steps 4 and 5 until b = b0 and the next contour point found is b1. The last two points b0 and b1 are repeated and should not be appended to the contour again. The first steps of the algorithm is illustrated in the figure below (only the pixels on the boundary are labelled 1 in this bitmap): In this problem, you will be given a bitmap with at most 200 rows and 200 columns. The bitmap contains a number of objects. You are to determine the length of the contour for each object in the bitmap using the procedure above. In the bitmap, a pixel intensity of 0 represents the background, and a pixel intensity of 1 represents an object pixel. Two pixels with intensity 1 belong to the same object if there is a path from one pixel to another consisting of only 1's, and the path is allowed to follow in any of the 8 compass directions. The borders of the bitmap (first row, last row, first column, last column) contain only background pixels. Any object consisting of fewer than 5 pixels should be ignored as it is most likely noise. None of the objects in the bitmap has holes. Equivalently, there exists a path of background pixels following only the 4 main compass directions (N, S, E, W) for every pair of background pixels in the bitmap. Input The input consists of a number of cases. Each case starts with two positive integers on a line, indicating the number of rows (R) and the number of columns (C) in the bitmap. The bitmap is given in the following R lines each containing a string of 0's and 1's of length C. The input is terminated by a case starting with R = C = 0. The last case should not be processed. Output For each case, print the case number on its own line. In the next line, print the lengths of the contours of all objects found in the bitmap, sorted in ascending order. Separate the contour lengths by a single space on that line. If the bitmap has no object that have at least 5 pixels, output the line 'no objects found' instead. Sample Input 7 7 0000000 0011110 0111100 0011100 0111100 0111100 0000000 16 7 0000000 0011110 0111100 0011100 0111100 0111100 0000000 0011000 0100110 0000000 0001000 0010100 0010000 0111000 0111000 0000000 4 4 0000 0000 0010 0000 0 0 Sample Output Case 1 14 Case 2 8 12 14 Case 3 no objects found
如何在自定义surfaceView 绘图面板上放置图片 或者bitmap
我在涂鸦面板上绘制图片以bitmap形式保存涂鸦 在转变成byte的形式存入数据库请问如何把数据库中的涂鸦再打开显示到绘图面板上 期待各位大神的回复
关于 revit二次开发的材质贴图路径的获取
在网上搜罗了相关的博客所有的几乎都是用的一个方法那就是在Asset里面去查找材质对应的AssetProperty,当AssetProperty是“unifiedbitmap_Bitmap”时就得到了贴图的路径。 但奇怪的是贴图路径并不像我想象的那样就是一个绝对路径的字符串。 在我多次实验后得了如下几种不同的路径格式(几种路径贴在文末了),而其中只有第一个是期望返回的路径。(可能还有奇怪的路径没发现的,这是我在测试时的到的不同情况) ### **所以我要怎么才能稳定得到第一种期望得到的返回值呢???** 下面是我获取贴图路径时参考的两篇博客 [参考博客1](https://blog.csdn.net/beckhans/article/details/51556415). [参考博客2](https://blog.csdn.net/zouzouol/article/details/89329573). ``` //期望返回的路径 unifiedbitmap_Bitmap : C:\Program Files (x86)\Common Files\Autodesk Shared\Materials\Textures\3\Mats\Finishes.Flooring.Carpet.4.png //一个不完整的路径重复了三次 unifiedbitmap_Bitmap : 1/Mats/Woods & Plastics.Finish Carpentry.Wood.Walnut.png|1/Mats/Woods & Plastics.Finish Carpentry.Wood.Walnut.png|1/Mats/Woods & Plastics.Finish Carpentry.Wood.Walnut.png //这里应该是说明1、2、3文件夹里都有这个贴图,但路径应该只能返回引用的贴图路径吧 unifiedbitmap_Bitmap : 1\Mats\Sitework.Planting.Soil.jpg| 2\Mats\Sitework.Planting.Soil.jpg| 3\Mats\Sitework.Planting.Soil.jpg //只是个贴图的名字 unifiedbitmap_Bitmap : Woods & Plastics.Finish Carpentry.Wood.Cherry.png //路径重复三次,而且路径里还多个反斜杠 unifiedbitmap_Bitmap : C:/Program Files (x86)/Common Files/Autodesk Shared/Materials/Textures/\1/Mats/Furnishings.Fabrics.Linen.bump.png|C:/Program Files (x86)/Common Files/Autodesk Shared/Materials/Textures/\1/Mats/Furnishings.Fabrics.Linen.bump.png|C:/Program Files (x86)/Common Files/Autodesk Shared/Materials/Textures/\1/Mats/Furnishings.Fabrics.Linen.bump.png ``` (第一次提问不知道怎么弄标签,就贴了个沾边的C#。。。)
StaticBitmap和bitmap有什么区别,在python中图像处理
请问StaticBitmap和bitmap有什么区别 StaticBitmap和bitmap有什么区别,在python中图像处理
如何将SurfaceView中的Canvas保存为Bitmap?
普通的Canvas可以通过下面的方法来将绘制内容保存为Bitmap ``` Bitmap bitmap = new Bitmap(width, height, Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); canvas.drawXXX ``` 但问题是,SurfaceView中Canvas是通过lockCanvas获取的,请问这种情况下,该如何将Canvas保存为Bitmap呢??
C#如何使Load下的两段代码分开执行?
``` private void Origination_Load(object sender, EventArgs e) { progressBar1.Minimum = 0; progressBar1.Maximum = 50; progressBar1.MarqueeAnimationSpeed = 50; Counter.Start(); //启动计时器 } private void Origination_Load(object sender, EventArgs e) { bit = new Bitmap("25.jpg"); bit.MakeTransparent(Color.Blue); } protected override void OnPaint(PaintEventArgs e) { e.Graphics.DrawImage((Image)bit, new Point(0, 0)); //在窗体上绘制图片 } ``` 第一段是一个进度条代码,第二个是非矩形窗体代码,都要写在Load事件下,这样会报错:已定义了一个名为“Origination_Load”的具有相同参数类型的成员。我改成了 ``` private void Origination_Load_1(object sender, EventArgs e) ``` 这样又会报错 “System.ArgumentNullException”类型的未经处理的异常出现在 System.Drawing.dll 中。 其他信息: 值不能为 null。
如何使用bitmap增加图像的高度和宽度?
我创建了一个类名称是 ImageLoader,使用内存缓存来存储从 web 中解析的所有的图片,使用 DisplayImage 方法传递 url,布局中的 imageview 来显示 image。 问题是我想增加图像的高度和宽度,我从布局中来添加,但是没有实现。 public void DisplayImage(String url, ImageView imageView) { list_of_image = new ArrayList<Drawable>(); imageViews.put(imageView, url); Bitmap bitmap=memoryCache.get(url); if(bitmap!=null) { imageView.setImageBitmap(bitmap); ///list_of_image.add(new BitmapDrawable(bitmap2)); } else { queuePhoto(url, imageView); imageView.setImageResource(stub_id); } } 什么问题呢?
根据图片url转化为bitmap 赋值给image可以显示,但是打印toast为空
请教大家一个问题,我从数据库中读取图片url 然后转化为bitmap 赋值给image 控件,可以将图片显示出来,但是为什么打印bitmap是null呢? ![图片说明](https://img-ask.csdn.net/upload/201707/20/1500522757_376853.png) ![图片说明](https://img-ask.csdn.net/upload/201707/20/1500522794_751989.png) 这样图片可以显示出来,但是bitamp打印出来是null 是为什么呢
怎么把YUV422转bitmap,java
跪求YUV422转bitmap的java代码,网上百度了一些好像不顶用。
golang中使用walk展示二维码图片
![图片说明](https://img-ask.csdn.net/upload/201912/17/1576568318_853567.png) **我的需求是点击生成二维码 在下面展示二维码。 **部分代码如下,初学golang 请教各位大佬** ``` type MyMainWindow struct { *walk.MainWindow hcName *walk.Label userIdName *walk.Label startTime *walk.DateEdit endTime *walk.DateEdit hc, userId *walk.LineEdit imageView *walk.ImageView imageComposite *walk.Composite qrCount int } func (mw *MyMainWindow) ShowQRcode() { if mw.imageComposite != nil { mw.imageComposite.Dispose() } mw.getQRcode() widgets := []Widget{} for i:=1;i<=mw.qrCount;i++ { bitmap, err := walk.NewBitmapFromFile("qrcode/qr_"+strconv.Itoa(i)+".jpg") log.Println("qrcode/qr_"+strconv.Itoa(i)+".jpg") if err != nil { walk.MsgBox(mw, mw.Title(), err.Error(), walk.MsgBoxIconError) break } widget := ImageView{ Image: bitmap, Mode: ImageViewModeZoom, } widgets = append(widgets, widget) } imageComposite := Composite{ AssignTo: &mw.imageComposite, Layout: HBox{}, Children: widgets, } if err := imageComposite.Create(NewBuilder(mw)); err != nil { log.Println(err) } } func openWindow(){ mw := &MyMainWindow{} _, _ = MainWindow{ Title: "梅清打印量上报", MinSize: Size{600, 400}, Size:Size{1200,800}, Layout: VBox{MarginsZero: true}, Children: []Widget{ Composite{ Layout:HBox{}, Children: []Widget{ Label{AssignTo: &mw.hcName,Text: "医院编号"}, LineEdit{AssignTo: &mw.hc,}, Label{AssignTo: &mw.userIdName,Text: "工程师编号"}, LineEdit{AssignTo: &mw.userId,}, DateEdit{AssignTo:&mw.startTime, Format:"yyyy-MM-dd",}, DateEdit{AssignTo:&mw.endTime, Format:"yyyy-MM-dd",}, PushButton{ Text: "生成二维码", OnClicked: func(){ if len(mw.hc.Text()) == 0 { walk.MsgBox(mw, mw.Title(), "请输入医院编号", walk.MsgBoxIconError) log.Println("请输入医院编号") return } if len(mw.userId.Text()) == 0 { walk.MsgBox(mw, mw.Title(), "请输入工程师编号", walk.MsgBoxIconError) log.Println("请输入工程师编号") return } mw.ShowQRcode() }, }, }, }, Composite{ AssignTo:&mw.imageComposite, Layout:HBox{}, }, }, }.Run() } ``` 这是报错信息 ![图片说明](https://img-ask.csdn.net/upload/201912/24/1577177949_302636.png)
android InputStream转化成Bitmap
``` InputStream in=con.getInputStream(); Bitmap bit=BitmapFactory.decodeStream(in); Message msg=Message.obtain(); msg.obj=bit; handler.sendMessage(msg); ``` 1、bitmap这个类的作用是什么? 2、静态方法 obtain 为什么效率高?
android中怎么把一个Bitmap图片转换成file类型
我是根据一个URL从网上解析到的图片,代码如下: //创建一个url对象 URL url=new URL(showHeadimg); //打开URL对应的资源输入流 InputStream is= url.openStream(); //从InputStream流中解析出图片 Bitmap bitmap = BitmapFactory.decodeStream(is); 现在想把这个bitmap转成一个File类型提交到后台,请问要怎么做? 请各位帮帮忙了!
Typesetting 是怎么来实现的
Problem Description Modern fonts are generally of two varieties: outline fonts, whose glyphs (the individual character shapes) are specified mathematically as a set of curves, and bitmap fonts, whose glyphs are specified as patterns of pixels. Fonts may also include embedded information such as kerning pairs (adjusting the spacing between certain pairs of glyphs, such as "AW", so that they appear spaced correctly), tracking hints (for managing inter-glyph spacing), antialiasing hints (smoothing of pixellated edges), and much more. To be sure, modern fonts are more than a simple collection of shapes, and displaying them properly is a common programming challenge. For this problem we will concern ourselves with bitmapped fonts and a simple form of typesetting called glyph packing. Essentially, the idea is to pack the glyphs as tightly as possible while maintaining at least one horizontal pixel of separation between glyphs. For example, consider the glyphs shown to the left below for the Roman characters "P" and "J". The figure to the right shows them after glyph packing. Note that they are as close as possible without touching horizontally. Here's another example. In this case, notice that the final glyph cannot be packed at all. After packing, pixels from distinct glyphs may be adjacent diagonally or vertically, but not horizontally. The following example shows that pixels may be adjacent diagonally. The "Love" test case in the example input section shows that they may be adjacent vertically. Glyph packing has the nice property that it's easy to build "fancy" glyphs into the font so that glyph packing creates special effects with no extra work. Look at the "Toy" example below. The same simple packing process has been applied to these glyphs as to the ones above, but the result is more dramatic: Glyph packing has a few caveats, however, one of which we must concern ourselves with for this problem. Consider the example on the left below where a glyph for a hyphen is followed by a glyph for an underscore. Based on our one horizontal pixel of separation rule, how would this pack? Clearly something more is needed, and that something more is hinting within the glyphs themselves. Recall that in actual practice, fonts contain kerning pairs, tracking hints, etc. For our purposes, our hinting will be limited to "invisible" pixels that count as a pixel for the purpose of packing, but not for display. The center image below represents invisible pixels as open dots instead of closed dots. Now the two glyphs can be properly packed, resulting in the output shown on the right. Now for the formal definition of a proper packing: (1) Glyphs are packed as close as possible without allowing any pixels from different glyphs to be immediately horizontally adjacent; (2) Given two glyphs, they may not be packed in such a way that any pixel of the leftmost glyph at a given height ends up positioned to the right of any pixel at the same height in the rightmost glyph. Condition (2) above is easily understood by visualizing two glyphs sitting side by side, separated by a small space. If you "squeeze" them together, condition (2) says that their pixels are not allowed to "pass through" one another. Consider the example to the left below. The center image is not the proper packing, because it violates condition (2) of the formal definition. The image on the right is the proper packing of these glyphs. Input The input for this problem is sets of glyphs to be packed. In a given test case, all glyphs are the same height, and an integer, N, on the first line of the test case specifies this height. The next N lines contain the glyphs to be packed. Empty pixels in a glyph are represented by a dot '.' character. Non-empty pixels are represented by a hash mark '#' for visible pixels, and a zero '0' for invisible pixels. Glyphs are separated by a single column of space characters. The input will always consist of more than one glyph, at least one of which will always contain at least one visible pixel. A glyph will always have at least one non-empty pixel in its leftmost and rightmost column, and every glyph will have at least one non-empty pixel at the same height as at least one other glyph in the input. The minimum dimension of a glyph is 1 × 1, the maximum dimension is 20 × 20, and the maximum number of glyphs that will appear in any test case is 20. Test cases continue until a value of zero is specified for N. Output For each test case, first output the number of that test case (starting with 1) on a line by itself. Then output the proper packing of the input glyphs, using the dot '.' character for empty pixels and for invisible pixels, and the hash mark '#' character for visible pixels. Omit leading and trailing empty columns (columns with no visible pixels) so that both the leftmost and rightmost output columns contain at least one visible pixel. Sample Input 8 ###. ...# #..# ...# #..# ...# ###. ...# #... ...# #... ...# #... #..# #... #### 8 ############# .... ............. ..#.......... .... ............. ..#.......... .##. .........#..# ..#.......... #..# .........#..# ..#.......... #..# .........#..# ..#.......... .##. ..........### ............. .... ............# ............. .... ############. 8 ############# ............. ..#.......... ............. ..#.......... .........#..# ..#.......... .........#..# ..#.......... .........#..# ..#.......... ..........### ............. ............# ............. ############. 5 0..0 0..0 0..0 0..0 #### 0..0 0..0 0..0 0..0 #### 5 #.... .###. #.... #...# #...# #...# #...# ....# .###. ....# 3 ### 0.0 ### #.# 0.0 #.# ### 0.0 ### 3 0.0 ### 0.0 0.0 #.# 0.0 0.0 ### 0.0 8 #.... .... ..... .... #.... .... ..... .... #.... .##. #...# .##. #.... #..# .#.#. #..# #.... #..# .#.#. #..# #.... #..# .#.#. ###. #.... .##. ..#.. #... ##### .... ..#.. .### 0 Sample Output 1 ###..# #..#.# #..#.# ###..# #....# #....# #.#..# #.#### 2 ############# ..#.......... ..#..##..#..# ..#.#..#.#..# ..#.#..#.#..# ..#..##...### ............# ############. 3 .....############# .......#.......... .......#.#..#..... .......#.#..#..... .......#.#..#..... .......#..###..... ............#..... ############...... 4 ......... ......... ####..... ......... .....#### 5 #......###. #.....#...# #...#.#...# #...#.....# .###......# 6 ###.....### #.#.....#.# ###.....### 7 ### #.# ### 8 #.............. #.............. #..##.#...#.##. #.#..#.#.#.#..# #.#..#.#.#.#..# #.#..#.#.#.###. #..##...#..#... #####...#...###
C# wpf bitmap在image控件中显示
希望点击按钮后,将图片在IMAGE控件中显示,怎么实现 private void button1_Click(object sender, RoutedEventArgs e) { CStaresq IMEAGE = new CStaresq(); CStareim IMASIN = new CStareim(); IMEAGE .ReadandUpload (conn,UploadFilenames[0]); byte[] ImageShow = IMEAGE.Picbuf[0]; MemoryStream ms1 = new MemoryStream(ImageShow); System.Drawing.Bitmap bm = (Bitmap)System.Drawing.Image.FromStream(ms1); conn.Close(); ms1.Close(); }
使用 Bitmap 时,图片不能显示
请大家帮我看看下面的代码,为什么图像不能在list中显示,然而空间和图像的其他描述却能看得见。 public class Test extends ListActivity { Prefs myprefs = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listplaceholder); this.myprefs = new Prefs(getApplicationContext()); // install handler for processing gui update messages ArrayList<HashMap<String, Object>> mylist = new ArrayList<HashMap<String, Object>>(); JSONObject json = JSONfunctions.getJSONfromURL("http://midsweden.gofreeserve.com/proj/androidjson.php?identifier=" + Test.this.myprefs.getPersonalno()); try{ JSONArray earthquakes = json.getJSONArray("services"); for(int i=0;i<earthquakes.length();i++){ HashMap<String, Object> map = new HashMap<String, Object>(); JSONObject e = earthquakes.getJSONObject(i); map.put("id", e.getString("taskid")); map.put("pic", "Service name : " + e.getString("employeepic")); map.put("serviceinfo", "" + e.getString("employeename")+ " : "+ e.getString("starttime") +" To " + e.getString("endtime")); BmpFromURL myBmpFromURL = new BmpFromURL("http://midsweden.gofreeserve.com/proj/admin/pictures/file87619.jpg"); Bitmap myBitmap = myBmpFromURL.getMyBitmap(); map.put("img",myBitmap); mylist.add(map); } }catch(JSONException e) { Log.e("log_tag", "Error parsing data "+e.toString()); } SimpleAdapter adapter = new SimpleAdapter(this, mylist , R.layout.test,new String[] {"img", "servicename", "serviceinfo" }, new int[] { R.id.image ,R.id.item_title, R.id.item_subtitle }); setListAdapter(adapter); final ListView lv = getListView(); lv.setTextFilterEnabled(true); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @SuppressWarnings("unchecked") HashMap<String, String> o = (HashMap<String, String>) lv.getItemAtPosition(position); Toast.makeText(Test.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.settings: Intent intent = new Intent(this, ShowSettings.class); startActivity(intent); break; case R.id.web: Intent intent4 = new Intent(this, MenuActivity.class); startActivity(intent4); break; case R.id.services: Intent intent2 = new Intent(this, Test.class); startActivity(intent2); break; case R.id.Quit: Intent intent3 = new Intent(this, ServicesDemo.class); startActivity(intent3); break; default: break; } return true; } } Bitmap class public class BmpFromURL { private Bitmap myBitmap; public BmpFromURL(String imageURL){ URL myImageURL = null; try { myImageURL = new URL(imageURL); } catch (MalformedURLException error) { error.printStackTrace(); } try { HttpURLConnection connection = (HttpURLConnection)myImageURL .openConnection(); connection.setDoInput(true); connection.connect(); InputStream input = connection.getInputStream(); myBitmap = BitmapFactory.decodeStream(input); } catch (IOException e) { e.printStackTrace(); } } public Bitmap getMyBitmap() { return myBitmap; } } xml 文件 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cacheColorHint="#55000000" android:background="#55000000" > <ImageView android:id="@+id/image" android:layout_width="50dip" android:layout_height="50dip" /> <TextView android:id="@+id/item_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceMedium" android:padding="2dp" android:textSize="20dp" /> <TextView android:id="@+id/item_subtitle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="2dp" android:textSize="18dp" /> </LinearLayout>
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Vue + Spring Boot 项目实战(十四):用户认证方案与完善的访问拦截
本篇文章主要讲解 token、session 等用户认证方案的区别并分析常见误区,以及如何通过前后端的配合实现完善的访问拦截,为下一步权限控制的实现打下基础。
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入  假设现有4个人
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
写在前面: 我是 扬帆向海,这个昵称来源于我的名字以及女朋友的名字。我热爱技术、热爱开源、热爱编程。技术是开源的、知识是共享的。 这博客是对自己学习的一点点总结及记录,如果您对 Java、算法 感兴趣,可以关注我的动态,我们一起学习。 用知识改变命运,让我们的家人过上更好的生活。 目录一、杨辉三角的介绍二、杨辉三角的算法思想三、代码实现1.第一种写法2.第二种写法 一、杨辉三角的介绍 百度
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
SQL-小白最佳入门sql查询一
一 说明 如果是初学者,建议去网上寻找安装Mysql的文章安装,以及使用navicat连接数据库,以后的示例基本是使用mysql数据库管理系统; 二 准备前提 需要建立一张学生表,列分别是id,名称,年龄,学生信息;本示例中文章篇幅原因SQL注释略; 建表语句: CREATE TABLE `student` ( `id` int(11) NOT NULL AUTO_INCREMENT, `
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // dosho
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,
程序员:我终于知道post和get的区别
IT界知名的程序员曾说:对于那些月薪三万以下,自称IT工程师的码农们,其实我们从来没有把他们归为我们IT工程师的队伍。他们虽然总是以IT工程师自居,但只是他们一厢情愿罢了。 此话一出,不知激起了多少(码农)程序员的愤怒,却又无可奈何,于是码农问程序员。 码农:你知道get和post请求到底有什么区别? 程序员:你看这篇就知道了。 码农:你月薪三万了? 程序员:嗯。 码农:你是怎么做到的? 程序员:
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员
Android 9.0系统新特性,对刘海屏设备进行适配
其实Android 9.0系统已经是去年推出的“老”系统了,这个系统中新增了一个比较重要的特性,就是对刘海屏设备进行了支持。一直以来我也都有打算针对这个新特性好好地写一篇文章,但是为什么直到拖到了Android 10.0系统都发布了才开始写这篇文章呢?当然,一是因为我这段时间确实比较忙,今年几乎绝大部分的业余时间都放到写新书上了。但是最主要的原因并不是这个,而是因为刘海屏设备的适配存在一定的特殊性
网易云6亿用户音乐推荐算法
网易云音乐是音乐爱好者的集聚地,云音乐推荐系统致力于通过 AI 算法的落地,实现用户千人千面的个性化推荐,为用户带来不一样的听歌体验。 本次分享重点介绍 AI 算法在音乐推荐中的应用实践,以及在算法落地过程中遇到的挑战和解决方案。 将从如下两个部分展开: AI 算法在音乐推荐中的应用 音乐场景下的 AI 思考 从 2013 年 4 月正式上线至今,网易云音乐平台持续提供着:乐屏社区、UGC
【技巧总结】位运算装逼指南
位算法的效率有多快我就不说,不信你可以去用 10 亿个数据模拟一下,今天给大家讲一讲位运算的一些经典例子。不过,最重要的不是看懂了这些例子就好,而是要在以后多去运用位运算这些技巧,当然,采用位运算,也是可以装逼的,不信,你往下看。我会从最简单的讲起,一道比一道难度递增,不过居然是讲技巧,那么也不会太难,相信你分分钟看懂。 判断奇偶数 判断一个数是基于还是偶数,相信很多人都做过,一般的做法的代码如下
日均350000亿接入量,腾讯TubeMQ性能超过Kafka
整理 | 夕颜出品 | AI科技大本营(ID:rgznai100) 【导读】近日,腾讯开源动作不断,相继开源了分布式消息中间件TubeMQ,基于最主流的 OpenJDK8开发的
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
面试官如何考察你的思维方式?
1.两种思维方式在求职面试中,经常会考察这种问题:北京有多少量特斯拉汽车? 某胡同口的煎饼摊一年能卖出多少个煎饼? 深圳有多少个产品经理? 一辆公交车里能装下多少个乒乓球? 一
相关热词 c# 图片上传 c# gdi 占用内存 c#中遍历字典 c#控制台模拟dos c# 斜率 最小二乘法 c#进程延迟 c# mysql完整项目 c# grid 总行数 c# web浏览器插件 c# xml 生成xsd
立即提问