Click here to Skip to main content
15,511,131 members
Home / Discussions / Graphics
   

Graphics

 
QuestionSplit one image into six smaller, component images. Pin
Brady Kelly12-Jul-15 1:28
Brady Kelly12-Jul-15 1:28 
AnswerRe: Split one image into six smaller, component images. Pin
Richard Deeming13-Jul-15 1:40
mveRichard Deeming13-Jul-15 1:40 
GeneralRe: Split one image into six smaller, component images. Pin
Brady Kelly13-Jul-15 1:46
Brady Kelly13-Jul-15 1:46 
GeneralRe: Split one image into six smaller, component images. Pin
Richard Deeming13-Jul-15 1:50
mveRichard Deeming13-Jul-15 1:50 
GeneralRe: Split one image into six smaller, component images. Pin
Manfred Rudolf Bihy13-Jul-15 3:10
professionalManfred Rudolf Bihy13-Jul-15 3:10 
GeneralRe: Split one image into six smaller, component images. Pin
Brady Kelly13-Jul-15 3:12
Brady Kelly13-Jul-15 3:12 
GeneralRe: Split one image into six smaller, component images. Pin
Manfred Rudolf Bihy13-Jul-15 4:10
professionalManfred Rudolf Bihy13-Jul-15 4:10 
QuestionColor issue with custom cursor Pin
Super Lloyd4-Jun-15 4:45
Super Lloyd4-Jun-15 4: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 5:03
professionalEddy Vluggen4-Jun-15 5:03 
GeneralRe: Color issue with custom cursor Pin
Super Lloyd4-Jun-15 15:19
Super Lloyd4-Jun-15 15:19 
AnswerRe: Color issue with custom cursor Pin
Brisingr Aerowing18-Feb-16 18:29
professionalBrisingr Aerowing18-Feb-16 18:29 
GeneralRe: Color issue with custom cursor Pin
Super Lloyd19-Feb-16 1:15
Super Lloyd19-Feb-16 1:15 
QuestionHow to convert graphics to ttf? Pin
ts_chen24-May-15 0:13
ts_chen24-May-15 0:13 
Question3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Austin_Cpp27-Mar-15 16:02
Austin_Cpp27-Mar-15 16:02 
AnswerRe: 3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Richard MacCutchan27-Mar-15 23:12
mveRichard MacCutchan27-Mar-15 23:12 
GeneralRe: 3D mesh Surface with C++ GDI / GDI+ / simple canvas Pin
Austin_Cpp27-Mar-15 23:33
Austin_Cpp27-Mar-15 23:33 
Questionhow to compare if two image are roughly the same with threshold? Pin
neodeaths27-Feb-15 12:05
neodeaths27-Feb-15 12:05 
QuestionNumber of vertices in Blender vs number of vertices in XNA Pin
KamranKamal23-Feb-15 13:46
KamranKamal23-Feb-15 13:46 
AnswerRe: Number of vertices in Blender vs number of vertices in XNA Pin
KamranKamal24-Feb-15 0:53
KamranKamal24-Feb-15 0:53 
QuestionLooking for Cartesian graphic component for dotnet.... Pin
Sam Marrocco15-Jan-15 7:36
Sam Marrocco15-Jan-15 7:36 
Answeruse System.Drawing namespace; Pin
Nitin K. Kawale26-Jan-15 18:50
professionalNitin K. Kawale26-Jan-15 18:50 
GeneralRe: use System.Drawing namespace; Pin
Sam Marrocco27-Jan-15 3:35
Sam Marrocco27-Jan-15 3:35 
QuestionRotate TTF Font Glyph? Pin
radarcontact29-Nov-14 15:25
radarcontact29-Nov-14 15:25 
QuestionDx installation Pin
Otekpo Emmanuel20-Nov-14 20:20
Otekpo Emmanuel20-Nov-14 20:20 
AnswerRe: Dx installation Pin
Richard MacCutchan20-Nov-14 22:52
mveRichard MacCutchan20-Nov-14 22: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.