Jump to content
Xtreme .Net Talk

Menge

Avatar/Signature
  • Posts

    108
  • Joined

  • Last visited

Everything posted by Menge

  1. one very easy to understand way is go around all the pixels in the image and each by each compare the RGB values with the ones you consider valid and substitute :) like, if the R is bigger than the G and B and the difference between G and B is no larger than 50%, then that's reddish, so red and so on :P
  2. hmm... being a little stupid here (but the best solution i could think of first hand), you could draw to various surfaces and then compose it. as in each block of polys would end up being atexture that you would compose afterwards... this would force you to render back->front tho maybe i'm just stupid :P
  3. i change the mesh's vertex color and it works great for me.
  4. i think you are compiling your application to a Console EXE instead of a Win32 EXE. can you confirm that? it should be on your projects build configs :)
  5. hrm... the image's Stride is the size of a line of the image in Bytes. (800x600 image at 32bpp = stride of 800pixels * (32bits/8bitsperbyte)) hope this helps :)
  6. omg! lol i just did some math! lol at 32bpp, u'd have around 1 terabyte of data on such HUGE map! lol
  7. hey! this happened on some "corrupt" jpeg files. some files that weren't completely downloaded, understand? just add some error catching there to find out which filename you are on and check the file. to fix this, i believe you could go and create a Bitmap file, load that file with GDI+ and draw it and create the texture from that Bitmap. i think that'd work.
  8. Bitmap *p = new Bitmap(row,column,row*sizeo(char),System:rawing::Imaging::PixelFormat::Format8bppIndexed,iP); this is wrong. you are relating to the wrong thing. the row*sizeo(char) should be the size in bytes of the stride... meaning one line of the image. so it should be (assuming you are using 8 bits-per-pixel) Bitmap *p = new Bitmap(row,column,row,System:rawing::Imaging::PixelFormat::Format8bppIndexed,iP); it is now "row" because it's "row*1" since each pixel has 8bits = 1 byte. as for the rest of the code, i cant say much.
  9. where did you create the Graphics object from? if you want to paint onto a Bitmap, you must do Graphics g=Graphics.FromImage(IMAGE); // do your drawing with the "g" object IMAGE.Save(); you should create the Graphics FROM the Bitmap you want to paint on. check if it's that :P
  10. you have 2 options: either use Double Buffering and GDI+. or use directx... (yes, it'd fix it and so would Double Buffering with GDI+) :)
  11. hrm... well i have something... set the render target to a surface (here it's "front") and do this: // Locks the surface Microsoft.DirectX.Direct3D.GraphicsStream ImageStream = front.LockRectangle(dockBg, LockFlags.None); // Creates the bitmap from the surface internal data Bitmap MyBitmap = new Bitmap(WIDTH, HEIGHT, WIDTH*BYTES_PER_PIXEL, System.Drawing.Imaging.PixelFormat.Format32bppArgb, ImageStream.InternalData); // do your stuff with the bitmap // Dispose the stuff you just used front.UnlockRectangle(); MyBitmap.Dispose(); that code will get you a bitmap out of a surface... what you can do is, render the texture to the surface and then copy it. it was the fastest way i found in .Net. hope it helps :)
  12. does it use the vid card? i didn't know... i thought it was always on the cpu... but then again.... it has been pretty much dropped since dx7 right? it's the same interfaces, right?
  13. hrm... i believe in D3D, since it uses the GPU and thus freeing the CPU :)
  14. sorry... the only method i can think of is the GetPixel/SetPixel loop
  15. why dont u use only one image with a transparent key color (Color.Lime, for instance) and then use the MakeTransparent() method? if you NEED a mask, then u NEED to composite... and that's problematic...
  16. there is no other way i know of :S oh! u could use PNGs too... it avoids the compositing
  17. i gave u the answer above
  18. if u just want 1bit transparency u can use the MakeTransparent. BUT if u want something like a gradient of transparencies, u can go setting the color of a new image based on the 2 sources like DestBMP.SetPixel(x,y, Color.FromARGB(AlphaMaskBMP.GetPixel(x.y).A, ImageBMP.GetPixel(x,y).R, ImageBMP.GetPixel(x,y).G, ImageBMP.GetPixel(x,y).B);
  19. look at your task manager
  20. hrm... i think roughly speaking, the size of a bitmap can be measured by something like this: Width * Height * BitsPerPixel /8 = SizeInBytes to get the in KB, divide the result by 1024. In MB, the KB result again by 1024 and so on. k? i'm just counting the image size... no other additional info that might come with the Bitmap class :P
  21. AndreRyan, thx :P but it doenst do too well either :\ hehe really angry about this, i am. :)
  22. it's for a program which i'm making. its a laucher program. but i'm adding more features to it. the thing is. i have an Item type which is an alias to a folder on the hard drive... so clicking this item makes my program open the folder and display its contents. and for its UI, i'm using Direct3D. i find it very cool :) u can get an internal preview here AndreRyan, transparency keys doesn't work on XP-styled icons... that's where i'm having problems... on icons with an 8-bit alpha channel. usual 1-bit alpha channelled icons display just great :)
  23. it's because i need this explicitly on a Bitmap object. because DirectX requires a bitmap to create a texture from :\
  24. i dont know... but u can go and pretend stupid (like me) and do this - dont change the SourceBlend nor the DestinationBlend properties - use color keying when painting the images (this keeps the alpha values).
  25. i really need this on Bitmap format b/c i need to create a Direct3DTexture out of this... dang... i even tried this ItemIcon=Icon.FromHandle(FileInfo.hIcon); Bitmap IconPic=new Bitmap(128,128); Graphics g=Graphics.FromImage((Bitmap)IconPic); g.DrawIcon(ItemIcon, new Rectangle(new Point(0,0),new Size(128,128))); g.Dispose(); and EVEN SO it gets black borders around it... dang... any help?
×
×
  • Create New...