Click here to Skip to main content
15,441,758 members
Home / Discussions / Graphics
   

Graphics

 
QuestionSplit one image into six smaller, component images. Pin
Brady Kelly12-Jul-15 0:28
MemberBrady Kelly12-Jul-15 0:28 
AnswerRe: Split one image into six smaller, component images. Pin
Richard Deeming13-Jul-15 0:40
mveRichard Deeming13-Jul-15 0:40 
GeneralRe: Split one image into six smaller, component images. Pin
Brady Kelly13-Jul-15 0:46
MemberBrady Kelly13-Jul-15 0:46 
GeneralRe: Split one image into six smaller, component images. Pin
Richard Deeming13-Jul-15 0:50
mveRichard Deeming13-Jul-15 0:50 
GeneralRe: Split one image into six smaller, component images. Pin
Manfred Rudolf Bihy13-Jul-15 2:10
professionalManfred Rudolf Bihy13-Jul-15 2:10 
GeneralRe: Split one image into six smaller, component images. Pin
Brady Kelly13-Jul-15 2:12
MemberBrady Kelly13-Jul-15 2:12 
GeneralRe: Split one image into six smaller, component images. Pin
Manfred Rudolf Bihy13-Jul-15 3:10
professionalManfred Rudolf Bihy13-Jul-15 3:10 
QuestionColor issue with custom cursor Pin
Super Lloyd4-Jun-15 3:45
MemberSuper Lloyd4-Jun-15 3:45 
I successfully create a custom cursor from a 32x32 32bpppArgb (GDI) Bitmap with the following code:
C#
public static Cursor ToCursor(System.Drawing.Bitmap bmp, byte x, byte y)
{
    var stream = new MemoryStream();
    var hIcon = bmp.GetHicon();
    try
    {
        System.Drawing.Icon.FromHandle(hIcon).Save(stream);
    }
    finally { NativeMethods.DestroyIcon(hIcon); }

    stream.Seek(2, SeekOrigin.Begin);
    stream.WriteByte(2);
    stream.Seek(10, SeekOrigin.Begin);
    stream.WriteByte(x);
    stream.Seek(12, SeekOrigin.Begin);
    stream.WriteByte(y);
    stream.Seek(0, SeekOrigin.Begin);

    return new Cursor(stream);
}

However the colors of my cursor are all wrong!
It looks like it is using a palette / a limited set of 16/32/256 colors?!
Is it possible to have 24bits/32bits colors cursor? (i.e. with millions of possible color value)

[EDIT] Solved!
I found a way to do it! With the following API in sequences:
GetHIcon() <br />
CreateIconIndirect() <br />
CursorInteropHelper<br />

There was just some nagging issue to avoid GDI Object leaks which I solved by creating a
class SafeIconHandle : SafeHandle
All in one Menu-Ribbon Bar
DirectX for WinRT/C# since 2013!
Taking over the world since 1371!


modified 4-Jun-15 20:19pm.

AnswerRe: Color issue with custom cursor Pin
Eddy Vluggen4-Jun-15 4:03
professionalEddy Vluggen4-Jun-15 4:03 
GeneralRe: Color issue with custom cursor Pin
Super Lloyd4-Jun-15 14:19
MemberSuper Lloyd4-Jun-15 14:19 
AnswerRe: Color issue with custom cursor Pin
Brisingr Aerowing18-Feb-16 17:29
professionalBrisingr Aerowing18-Feb-16 17:29 
GeneralRe: Color issue with custom cursor Pin
Super Lloyd19-Feb-16 0:15
MemberSuper Lloyd19-Feb-16 0:15 
QuestionHow to convert graphics to ttf? Pin
ts_chen23-May-15 23:13
Memberts_chen23-May-15 23:13 
Question3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Austin_Cpp27-Mar-15 15:02
MemberAustin_Cpp27-Mar-15 15:02 
AnswerRe: 3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Richard MacCutchan27-Mar-15 22:12
mveRichard MacCutchan27-Mar-15 22:12 
GeneralRe: 3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Austin_Cpp27-Mar-15 22:33
MemberAustin_Cpp27-Mar-15 22:33 
Questionhow to compare if two image are roughly the same with threshold? Pin
neodeaths27-Feb-15 11:05
Memberneodeaths27-Feb-15 11:05 
QuestionNumber of vertices in Blender vs number of vertices in XNA Pin
KamranKamal23-Feb-15 12:46
MemberKamranKamal23-Feb-15 12:46 
AnswerRe: Number of vertices in Blender vs number of vertices in XNA Pin
KamranKamal23-Feb-15 23:53
MemberKamranKamal23-Feb-15 23:53 
QuestionLooking for Cartesian graphic component for dotnet.... Pin
Sam Marrocco15-Jan-15 6:36
MemberSam Marrocco15-Jan-15 6:36 
Answeruse System.Drawing namespace; Pin
Nitin K. Kawale26-Jan-15 17:50
professionalNitin K. Kawale26-Jan-15 17:50 
GeneralRe: use System.Drawing namespace; Pin
Sam Marrocco27-Jan-15 2:35
MemberSam Marrocco27-Jan-15 2:35 
QuestionRotate TTF Font Glyph? Pin
radarcontact29-Nov-14 14:25
Memberradarcontact29-Nov-14 14:25 
QuestionDx installation Pin
Otekpo Emmanuel20-Nov-14 19:20
MemberOtekpo Emmanuel20-Nov-14 19:20 
AnswerRe: Dx installation Pin
Richard MacCutchan20-Nov-14 21:52
mveRichard MacCutchan20-Nov-14 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.